diff options
author | Jeremy Allison <jra@samba.org> | 2000-06-05 20:55:57 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-06-05 20:55:57 +0000 |
commit | 6d8c131f50e708d4c009355a7c5fe026cf8d350a (patch) | |
tree | 11ecc2ee4fc959dd96feef8f05c5774a5cf5a4ed /source3/rpc_parse | |
parent | f87246df627f0d940b45f65f812c0c77a2dfa355 (diff) | |
download | samba-6d8c131f50e708d4c009355a7c5fe026cf8d350a.tar.gz samba-6d8c131f50e708d4c009355a7c5fe026cf8d350a.tar.bz2 samba-6d8c131f50e708d4c009355a7c5fe026cf8d350a.zip |
Some tidyup fixes (memory leaks etc.). Still no progress with the
"no driver" issue. I'm banging my head against comparitive packet
dumps right now...
Jeremy.
(This used to be commit 03cd4aa1443acd958593f37c61ff9c90a43c660b)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r-- | source3/rpc_parse/parse_prs.c | 6 | ||||
-rw-r--r-- | source3/rpc_parse/parse_spoolss.c | 19 |
2 files changed, 15 insertions, 10 deletions
diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c index 0e057e9403..d277182043 100644 --- a/source3/rpc_parse/parse_prs.c +++ b/source3/rpc_parse/parse_prs.c @@ -232,9 +232,6 @@ BOOL prs_grow(prs_struct *ps, uint32 extra_space) if ((new_data = Realloc(ps->data_p, new_size)) == NULL) { DEBUG(0,("prs_grow: Realloc failure for size %u.\n", (unsigned int)new_size)); - /* JRATEST */ - smb_panic("prs_grow: ralloc fail\n"); - /* JRATEST */ return False; } @@ -343,6 +340,9 @@ BOOL prs_append_prs_data(prs_struct *dst, prs_struct *src) BOOL prs_append_some_prs_data(prs_struct *dst, prs_struct *src, int32 start, uint32 len) { + if (len == 0) + return True; + if(!prs_grow(dst, len)) return False; diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c index 2e6f8ba590..4530f638bc 100644 --- a/source3/rpc_parse/parse_spoolss.c +++ b/source3/rpc_parse/parse_spoolss.c @@ -1529,7 +1529,7 @@ static BOOL new_smb_io_relsecdesc(char *desc, NEW_BUFFER *buffer, int depth, ********************************************************************/ static BOOL new_smb_io_reldevmode(char *desc, NEW_BUFFER *buffer, int depth, DEVICEMODE **devmode) { - prs_struct *ps=&(buffer->prs); + prs_struct *ps=&buffer->prs; prs_debug(ps, depth, desc, "new_smb_io_reldevmode"); depth++; @@ -2022,7 +2022,7 @@ static BOOL new_spoolss_io_buffer(char *desc, prs_struct *ps, int depth, NEW_BUF prs_debug(ps, depth, desc, "new_spoolss_io_buffer"); depth++; - if (!prs_uint32("ptr", ps, depth, &(buffer->ptr))) + if (!prs_uint32("ptr", ps, depth, &buffer->ptr)) return False; /* reading */ @@ -2031,7 +2031,7 @@ static BOOL new_spoolss_io_buffer(char *desc, prs_struct *ps, int depth, NEW_BUF buffer->string_at_end=0; if (buffer->ptr==0) { - if (!prs_init(&(buffer->prs), 0, 4, UNMARSHALL)) + if (!prs_init(&buffer->prs, 0, 4, UNMARSHALL)) return False; return True; } @@ -2039,10 +2039,10 @@ static BOOL new_spoolss_io_buffer(char *desc, prs_struct *ps, int depth, NEW_BUF if (!prs_uint32("size", ps, depth, &buffer->size)) return False; - if (!prs_init(&(buffer->prs), buffer->size, 4, UNMARSHALL)) + if (!prs_init(&buffer->prs, buffer->size, 4, UNMARSHALL)) return False; - if (!prs_append_some_prs_data(&(buffer->prs), ps, prs_offset(ps), buffer->size)) + if (!prs_append_some_prs_data(&buffer->prs, ps, prs_offset(ps), buffer->size)) return False; if (!prs_set_offset(&buffer->prs, 0)) @@ -2060,9 +2060,9 @@ static BOOL new_spoolss_io_buffer(char *desc, prs_struct *ps, int depth, NEW_BUF if (buffer->ptr==0) return True; - if (!prs_uint32("size", ps, depth, &(buffer->size))) + if (!prs_uint32("size", ps, depth, &buffer->size)) return False; - if (!prs_append_some_prs_data(ps, &(buffer->prs), 0, buffer->size)) + if (!prs_append_some_prs_data(ps, &buffer->prs, 0, buffer->size)) return False; return True; @@ -4543,6 +4543,11 @@ BOOL spoolss_io_q_setprinterdata(char *desc, SPOOL_Q_SETPRINTERDATA *q_u, prs_st return True; } +void free_spoolss_q_setprinterdata(SPOOL_Q_SETPRINTERDATA *q_u) +{ + safe_free(q_u->data); +} + /******************************************************************* ********************************************************************/ BOOL spoolss_io_r_setprinterdata(char *desc, SPOOL_R_SETPRINTERDATA *r_u, prs_struct *ps, int depth) |