mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-19 03:31:26 +00:00
scst_local: Fix scst_local_add_target() error path
Do not return a pointer to freed memory in *out_tgt. Detected by Coverity. Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user