1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

r14772: Fix coverity bug #258. Seems coverity has discovered talloc :-).

Jeremy.
(This used to be commit 488b7725168971e6e59f3a2a7476ce82df43579b)
This commit is contained in:
Jeremy Allison 2006-03-29 22:59:33 +00:00 committed by Gerald (Jerry) Carter
parent 621f91c693
commit b98703ccaa

View File

@ -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;
}