diff options
author | Jeremy Allison <jra@samba.org> | 2006-06-28 02:12:53 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:19:02 -0500 |
commit | 107698dd0e9b53e41003b677fef20f726a8a4ed6 (patch) | |
tree | ea1261a4c57a2986f7788b9fbcc77330fc8e69aa | |
parent | fc77e332e3be72d208ff33aa6ea0849b5a62b349 (diff) | |
download | samba-107698dd0e9b53e41003b677fef20f726a8a4ed6.tar.gz samba-107698dd0e9b53e41003b677fef20f726a8a4ed6.tar.bz2 samba-107698dd0e9b53e41003b677fef20f726a8a4ed6.zip |
r16601: Klocwork #2038. Fix memleak on error path.
Jeremy.
(This used to be commit 934dddb2fa9fb60a87c0b0be81db97f2b59c7cb0)
-rw-r--r-- | source3/rpc_parse/parse_eventlog.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source3/rpc_parse/parse_eventlog.c b/source3/rpc_parse/parse_eventlog.c index 5e28a4aba5..4aff9734ee 100644 --- a/source3/rpc_parse/parse_eventlog.c +++ b/source3/rpc_parse/parse_eventlog.c @@ -353,18 +353,18 @@ BOOL eventlog_io_r_read_eventlog(const char *desc, /* Now pad with whitespace until the end of the response buffer */ - r_u->end_of_entries_padding = - SMB_CALLOC_ARRAY(uint8, - q_u->max_read_size - r_u->num_bytes_in_resp); + if (q_u->max_read_size - r_u->num_bytes_in_resp) { + r_u->end_of_entries_padding = SMB_CALLOC_ARRAY(uint8, q_u->max_read_size - r_u->num_bytes_in_resp); - if(!(prs_uint8s(False, "end of entries padding", ps, - depth, r_u->end_of_entries_padding, - (q_u->max_read_size - r_u->num_bytes_in_resp)))) - { - return False; - } + if(!(prs_uint8s(False, "end of entries padding", ps, + depth, r_u->end_of_entries_padding, + (q_u->max_read_size - r_u->num_bytes_in_resp)))) { + free(r_u->end_of_entries_padding); + return False; + } - free(r_u->end_of_entries_padding); + free(r_u->end_of_entries_padding); + } /* We had better be DWORD aligned here */ |