diff options
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r-- | source3/rpc_parse/parse_spoolss.c | 22 |
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; } } |