From d0eeb9aa8db42ed1fc18024614560820354e6dfa Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 23 Dec 2008 12:11:12 -0800 Subject: Fix more asprintf warnings and some error path errors. Jeremy. --- source3/locking/posix.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'source3/locking/posix.c') diff --git a/source3/locking/posix.c b/source3/locking/posix.c index c036ee597c..9b51c3aa6a 100644 --- a/source3/locking/posix.c +++ b/source3/locking/posix.c @@ -909,13 +909,12 @@ new: start=%.0f,size=%.0f\n", (double)l_curr->start, (double)l_curr->size, */ char *msg = NULL; - /* Don't check if alloc succeeds here - we're - * forcing a core dump anyway. */ - - asprintf(&msg, "logic flaw in cases: l_curr: start = %.0f, size = %.0f : \ -lock: start = %.0f, size = %.0f", (double)l_curr->start, (double)l_curr->size, (double)lock->start, (double)lock->size ); - - smb_panic(msg); + if (asprintf(&msg, "logic flaw in cases: l_curr: start = %.0f, size = %.0f : \ +lock: start = %.0f, size = %.0f", (double)l_curr->start, (double)l_curr->size, (double)lock->start, (double)lock->size ) != -1) { + smb_panic(msg); + } else { + smb_panic("posix_lock_list"); + } } } /* end for ( l_curr = lhead; l_curr;) */ } /* end for (i=0; i