1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3-rpcclient: Fix cmd_eventlog_loginfo() null pointer passing.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>

Found by Coverity.
This commit is contained in:
Andreas Schneider 2012-12-21 15:58:49 +01:00 committed by Günther Deschner
parent 30e1dc08df
commit 9b0c1ab07c

View File

@ -510,6 +510,12 @@ static NTSTATUS cmd_eventlog_loginfo(struct rpc_pipe_client *cli,
return status;
}
buffer = talloc_array(mem_ctx, uint8_t, bytes_needed);
if (buffer == NULL) {
status = NT_STATUS_NO_MEMORY;
goto done;
}
status = dcerpc_eventlog_GetLogInformation(b, mem_ctx,
&handle,
0, /* level */
@ -526,8 +532,8 @@ static NTSTATUS cmd_eventlog_loginfo(struct rpc_pipe_client *cli,
}
buf_size = bytes_needed;
buffer = talloc_array(mem_ctx, uint8_t, bytes_needed);
if (!buffer) {
buffer = talloc_realloc(mem_ctx, buffer, uint8_t, bytes_needed);
if (buffer == NULL) {
status = NT_STATUS_NO_MEMORY;
goto done;
}