diff options
author | Jeremy Allison <jra@samba.org> | 2007-12-03 14:54:06 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-12-03 14:54:06 -0800 |
commit | bcf033b38ee2f6c76cd56cae5cd84a6e321ffafa (patch) | |
tree | 4e7fdd5f126bc59d62635bf1060d1fd6ca06aeec /source3/printing/printing.c | |
parent | df141905fa389bc4d86bce33d1a763164e120457 (diff) | |
download | samba-bcf033b38ee2f6c76cd56cae5cd84a6e321ffafa.tar.gz samba-bcf033b38ee2f6c76cd56cae5cd84a6e321ffafa.tar.bz2 samba-bcf033b38ee2f6c76cd56cae5cd84a6e321ffafa.zip |
Change tdb_unpack "P" to return a malloc'ed string rather
than expect a pstring space to put data into.
Fix the (few) callers.
Jeremy.
(This used to be commit 7722a7d2c63f84b8105aa775b39f0ceedd4ed513)
Diffstat (limited to 'source3/printing/printing.c')
-rw-r--r-- | source3/printing/printing.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c index d331e897f9..1613828b79 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -1352,17 +1352,19 @@ static void print_queue_receive(struct messaging_context *msg, DATA_BLOB *data) { fstring sharename; - pstring lpqcommand, lprmcommand; + char *lpqcommand = NULL, *lprmcommand = NULL; int printing_type; size_t len; len = tdb_unpack( (uint8 *)data->data, data->length, "fdPP", sharename, &printing_type, - lpqcommand, - lprmcommand ); + &lpqcommand, + &lprmcommand ); if ( len == -1 ) { + SAFE_FREE(lpqcommand); + SAFE_FREE(lprmcommand); DEBUG(0,("print_queue_receive: Got invalid print queue update message\n")); return; } @@ -1371,6 +1373,8 @@ static void print_queue_receive(struct messaging_context *msg, get_printer_fns_from_type((enum printing_types)printing_type), lpqcommand, lprmcommand ); + SAFE_FREE(lpqcommand); + SAFE_FREE(lprmcommand); return; } |