s3-spoolss: fix memleak of spoolss_Notify array in _spoolss_RouterRefreshPrinterChang...
authorGünther Deschner <gd@samba.org>
Thu, 12 Feb 2009 15:38:13 +0000 (16:38 +0100)
committerGünther Deschner <gd@samba.org>
Mon, 23 Feb 2009 15:17:35 +0000 (16:17 +0100)
Guenther

source3/rpc_server/srv_spoolss.c
source3/rpc_server/srv_spoolss_nt.c

index 17dbad698838f7a9ed4f63a1349927c139be4ca7..cfe3c994e5c183b6a76e3a68dbde0fbf97349251 100644 (file)
@@ -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);
 }
 
 
index b27680ca1c033dcd7aa364d9bc744c874b746dcd..a3daa7f372819bbe3ebdbcad25f59975f8d40ed9 100644 (file)
@@ -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;
                }