summaryrefslogtreecommitdiff
path: root/source3/rpc_parse
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-03-01 03:04:13 +0000
committerJeremy Allison <jra@samba.org>2001-03-01 03:04:13 +0000
commit7d853615338e4c81a2204f57a7fc22da725f55fe (patch)
treeae2e9c360852f9e559e5eb08199bc6fe989f639e /source3/rpc_parse
parentc014d3b709c0c71f6a092069f88854ee3f5387d3 (diff)
downloadsamba-7d853615338e4c81a2204f57a7fc22da725f55fe.tar.gz
samba-7d853615338e4c81a2204f57a7fc22da725f55fe.tar.bz2
samba-7d853615338e4c81a2204f57a7fc22da725f55fe.zip
rpc_parse/parse_spoolss.c: Fixed memory leak introduced by restructuring.
rpc_server/srv_spoolss_nt.c: Fixed problem with printer snum being read uninitialised. Jeremy. (This used to be commit 1552db715da576b41060f0d31d2c4cdec790c1d4)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r--source3/rpc_parse/parse_spoolss.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c
index 0a4375c1d4..3774a91100 100644
--- a/source3/rpc_parse/parse_spoolss.c
+++ b/source3/rpc_parse/parse_spoolss.c
@@ -2540,16 +2540,28 @@ static BOOL new_spoolss_io_buffer(char *desc, prs_struct *ps, int depth, NEW_BUF
return True;
}
else {
+ BOOL ret = False;
+
/* writing */
- if (buffer->ptr==0)
+ if (buffer->ptr==0) {
+ /* We have finished with the data in buffer->prs - free it. */
+ prs_mem_free(&buffer->prs);
return True;
-
+ }
+
if (!prs_uint32("size", ps, depth, &buffer->size))
- return False;
+ goto out;
+
if (!prs_append_some_prs_data(ps, &buffer->prs, 0, buffer->size))
- return False;
+ goto out;
- return True;
+ ret = True;
+ out:
+
+ /* We have finished with the data in buffer->prs - free it. */
+ prs_mem_free(&buffer->prs);
+
+ return ret;
}
}