From 5fe34329352ee1dcd5f5e994254456c46cd2a735 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 20 Dec 2012 02:20:24 +0000 Subject: [PATCH] scst_get_unique_sess_name(): Handle out-of-memory properly Return NULL instead of triggering a NULL pointer dereference if out of memory. Detected by Coverity. Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4656 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_targ.c | 1 + 1 file changed, 1 insertion(+) diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index 0097105cf..6906a5768 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -6474,6 +6474,7 @@ restart: PRINT_ERROR("Unable to allocate a " "replacement name (size %d)", len); + break; } }