Skip to content

Commit

Permalink
storage: Resource leak
Browse files Browse the repository at this point in the history
Signed-off-by: Donghwa Jeong <dh48.jeong@samsung.com>
  • Loading branch information
2xsec committed Jun 15, 2018
1 parent fbab55f commit 6666b28
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lxc/storage/storage_utils.c
Expand Up @@ -93,8 +93,10 @@ char *dir_new_path(char *src, const char *oldname, const char *name,

/* copy text up to oldname */
retlen = strlcpy(p, src, p2 - src);
if (retlen >= p2 - src)
if (retlen >= p2 - src) {
free(ret);
return NULL;
}

/* move target pointer (p) */
p += p2 - src;
Expand Down

0 comments on commit 6666b28

Please sign in to comment.