summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-03-29 22:59:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:47 -0500
commitb98703ccaa8b5057690dc36f8df8c6f588d83e6c (patch)
treebea0d33ddd494f15598a13c8660b81777ef6cb79
parent621f91c693ba6db628087433c6899bec37c85f0a (diff)
downloadsamba-b98703ccaa8b5057690dc36f8df8c6f588d83e6c.tar.gz
samba-b98703ccaa8b5057690dc36f8df8c6f588d83e6c.tar.bz2
samba-b98703ccaa8b5057690dc36f8df8c6f588d83e6c.zip
r14772: Fix coverity bug #258. Seems coverity has discovered talloc :-).
Jeremy. (This used to be commit 488b7725168971e6e59f3a2a7476ce82df43579b)
-rw-r--r--source3/rpc_parse/parse_shutdown.c14
1 files changed, 14 insertions, 0 deletions
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;
}