Skip to content

Commit

Permalink
soccr: don't leak memory on error paths
Browse files Browse the repository at this point in the history
CID 172198 (#1 of 1): Resource leak (RESOURCE_LEAK)
9. leaked_storage: Variable sk going out of scope leaks the storage it points to.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  • Loading branch information
avagin committed Mar 2, 2018
1 parent 7a5d310 commit 526f491
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion criu/sk-tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,10 @@ int restore_one_tcp(int fd, struct inet_sk_info *ii)
if (!sk)
return -1;

if (restore_tcp_conn_state(fd, sk, ii))
if (restore_tcp_conn_state(fd, sk, ii)) {
libsoccr_release(sk);
return -1;
}

return 0;
}
Expand Down

0 comments on commit 526f491

Please sign in to comment.