summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-09-11 23:21:16 +0000
committerJeremy Allison <jra@samba.org>2000-09-11 23:21:16 +0000
commit692fe0cabfaf4b0e13083aa5d6fc9dddb4e5dd5b (patch)
tree8a653ed2b1d5e238ea32039047b60df73aaacfea /source3/rpc_server
parent0b2e454703fc59b9c019fb8bded92cbc78432567 (diff)
downloadsamba-692fe0cabfaf4b0e13083aa5d6fc9dddb4e5dd5b.tar.gz
samba-692fe0cabfaf4b0e13083aa5d6fc9dddb4e5dd5b.tar.bz2
samba-692fe0cabfaf4b0e13083aa5d6fc9dddb4e5dd5b.zip
Fix for malloc of zero bytes found by insure.
Jeremy. (This used to be commit 2916790859acc56e582056774b02d4a33cedeaa4)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 2c0dc79fb2..da5b3e960f 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -3564,6 +3564,11 @@ uint32 _spoolss_enumjobs( POLICY_HND *handle, uint32 firstjob, uint32 numofjobs,
*returned = print_queue_status(snum, &queue, &prt_status);
DEBUGADD(4,("count:[%d], status:[%d], [%s]\n", *returned, prt_status.status, prt_status.message));
+ if (*returned == 0) {
+ safe_free(queue);
+ return NT_STATUS_NO_PROBLEMO;
+ }
+
switch (level) {
case 1:
return enumjobs_level1(queue, snum, buffer, offered, needed, returned);