From ac45265fd034c00838739a78ffdd94a0f53eaca0 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 16 Jun 2015 23:45:15 +0000 Subject: [PATCH] scst_local: Fix scst_local_add_target() error path Do not return a pointer to freed memory in *out_tgt. Detected by Coverity. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6343 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst_local/scst_local.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index abae3052f..5f3564c63 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1968,10 +1968,10 @@ static int scst_local_add_target(const char *target_name, res = 0; -out: if (out_tgt != NULL) *out_tgt = tgt; +out: TRACE_EXIT_RES(res); return res;