diff options
Diffstat (limited to 'source3/rpc_parse/parse_prs.c')
-rw-r--r-- | source3/rpc_parse/parse_prs.c | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c index 5b5834084f..1bda5ef506 100644 --- a/source3/rpc_parse/parse_prs.c +++ b/source3/rpc_parse/parse_prs.c @@ -897,99 +897,6 @@ BOOL prs_uint32_post(char *name, prs_struct *ps, int depth, uint32 *data32, return True; } -/******************************************************************* - frees a memory buffer. - ********************************************************************/ -void prs_free_data(prs_struct *buf) -{ - if (buf == NULL) - return; - - if (buf->data_p != NULL) - { - free(buf->data_p); - buf->data_p = NULL; - } - buf->buffer_size = 0; -} - -/******************************************************************* - reallocate a memory buffer -********************************************************************/ -BOOL prs_realloc_data(prs_struct *buf, size_t new_size) -{ - char *new_data; - - /* prs_sma_init(); JERRY */ - - prs_debug(buf, 200, "prs_realloc_data - before", "prs_realloc_data"); - - SMB_ASSERT(((ssize_t) new_size) >= 0); - - if (new_size == 0) - { - prs_free_data(buf); - return True; - } - - /* new_data = sma_realloc(prs_sma_region, buf->data_p, new_size); */ - new_data = realloc(buf->data_p, new_size); - - if (new_data != NULL) - { - if (new_size > buf->buffer_size) - { - memset(&new_data[buf->buffer_size], 0, - new_size - buf->buffer_size); - } - buf->data_p = new_data; - buf->buffer_size = new_size; - } - else if (buf->buffer_size >= new_size) - { - DEBUG(3, ("prs_realloc_data: warning - " - "could not realloc to %d\n", new_size)); - } - else - { - DEBUG(3, ("prs_realloc_data: error - " - "could not realloc to %d\n", new_size)); - - prs_free_data(buf); - return False; - } - - prs_debug(buf, 200, "prs_realloc_data - after", "prs_realloc_data"); - return True; -} - -/******************************************************************* - return the memory location specified by offset; may return NULL. - ********************************************************************/ -char *prs_data(const prs_struct *buf, uint32 offset) -{ - - /* do we have something to look at? */ - if (buf == NULL) - return NULL; - - /* check to make sure the offset is within range */ - if ((offset < 0) || (offset >= buf->buffer_size)) - return NULL; - - /* locate the memory address */ - if (buf->data_p != NULL) - { - return &(buf->data_p[offset]); - } - - /* default return */ - return NULL; -} - - - - /* useful function to store a structure in rpc wire format */ int tdb_prs_store(TDB_CONTEXT *tdb, char *keystr, prs_struct *ps) { |