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
This commit is contained in:
Bart Van Assche
2015-06-16 23:45:15 +00:00
parent 1eb5498df2
commit ac45265fd0

View File

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