summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-02-12 16:38:13 +0100
committerGünther Deschner <gd@samba.org>2009-02-23 16:17:35 +0100
commit9b453f9248de2fce117f029240530d199e039ce1 (patch)
tree4afc074b79a704367966e7483b5cf0aa10927b14
parent9af13015b256e5b0eec74e1c788c13e246cde850 (diff)
downloadsamba-9b453f9248de2fce117f029240530d199e039ce1.tar.gz
samba-9b453f9248de2fce117f029240530d199e039ce1.tar.bz2
samba-9b453f9248de2fce117f029240530d199e039ce1.zip
s3-spoolss: fix memleak of spoolss_Notify array in _spoolss_RouterRefreshPrinterChangeNotify.
Guenther
-rw-r--r--source3/rpc_server/srv_spoolss.c2
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/source3/rpc_server/srv_spoolss.c b/source3/rpc_server/srv_spoolss.c
index 17dbad6988..cfe3c994e5 100644
--- a/source3/rpc_server/srv_spoolss.c
+++ b/source3/rpc_server/srv_spoolss.c
@@ -199,8 +199,6 @@ static bool api_spoolss_rffpcnex(pipes_struct *p)
static bool api_spoolss_rfnpcnex(pipes_struct *p)
{
return proxy_spoolss_call(p, NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY);
- /* FIXME */
-// SAFE_FREE(r_u.info.data);
}
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index b27680ca1c..a3daa7f372 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -3574,7 +3574,10 @@ static bool construct_notify_printer_info(Printer_entry *print_hnd, struct spool
if (!search_notify(type, field, &j) )
continue;
- if((info->notifies = SMB_REALLOC_ARRAY(info->notifies, struct spoolss_Notify, info->count+1)) == NULL) {
+ info->notifies = TALLOC_REALLOC_ARRAY(info, info->notifies,
+ struct spoolss_Notify,
+ info->count + 1);
+ if (info->notifies == NULL) {
DEBUG(2,("construct_notify_printer_info: failed to enlarge buffer info->data!\n"));
free_a_printer(&printer, 2);
return False;
@@ -3630,7 +3633,10 @@ static bool construct_notify_jobs_info(print_queue_struct *queue,
if (!search_notify(type, field, &j) )
continue;
- if((info->notifies = SMB_REALLOC_ARRAY(info->notifies, struct spoolss_Notify, info->count+1)) == NULL) {
+ info->notifies = TALLOC_REALLOC_ARRAY(info, info->notifies,
+ struct spoolss_Notify,
+ info->count + 1);
+ if (info->notifies == NULL) {
DEBUG(2,("construct_notify_jobs_info: failed to enlarg buffer info->data!\n"));
return False;
}