From b98703ccaa8b5057690dc36f8df8c6f588d83e6c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 29 Mar 2006 22:59:33 +0000 Subject: r14772: Fix coverity bug #258. Seems coverity has discovered talloc :-). Jeremy. (This used to be commit 488b7725168971e6e59f3a2a7476ce82df43579b) --- source3/rpc_parse/parse_shutdown.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source3') diff --git a/source3/rpc_parse/parse_shutdown.c b/source3/rpc_parse/parse_shutdown.c index de850ca4cc..da33807733 100644 --- a/source3/rpc_parse/parse_shutdown.c +++ b/source3/rpc_parse/parse_shutdown.c @@ -32,9 +32,18 @@ void init_shutdown_q_init(SHUTDOWN_Q_INIT *q_s, const char *msg, uint32 timeout, BOOL do_reboot, BOOL force) { q_s->server = TALLOC_P( get_talloc_ctx(), uint16 ); + if (!q_s->server) { + smb_panic("init_shutdown_q_init: talloc fail.\n"); + return; + } + *q_s->server = 0x1; q_s->message = TALLOC_ZERO_P( get_talloc_ctx(), UNISTR4 ); + if (!q_s->message) { + smb_panic("init_shutdown_q_init: talloc fail.\n"); + return; + } if ( msg && *msg ) { init_unistr4( q_s->message, msg, UNI_FLAGS_NONE ); @@ -206,6 +215,11 @@ Inits a structure. void init_shutdown_q_abort(SHUTDOWN_Q_ABORT *q_s) { q_s->server = TALLOC_P( get_talloc_ctx(), uint16 ); + if (!q_s->server) { + smb_panic("init_shutdown_q_abort: talloc fail.\n"); + return; + } + *q_s->server = 0x1; } -- cgit