1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

r16601: Klocwork #2038. Fix memleak on error path.

Jeremy.
(This used to be commit 934dddb2fa)
This commit is contained in:
Jeremy Allison 2006-06-28 02:12:53 +00:00 committed by Gerald (Jerry) Carter
parent fc77e332e3
commit 107698dd0e

View File

@ -353,19 +353,19 @@ 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 */
if(!(prs_uint32("sent size", ps, depth, &(r_u->sent_size))))