Unverified Commit c693e2f0 by Christian Brauner Committed by GitHub

Merge pull request #2406 from 2xsec/bugfix

storage: Resource leak
parents fbab55f3 6666b28f
...@@ -93,8 +93,10 @@ char *dir_new_path(char *src, const char *oldname, const char *name, ...@@ -93,8 +93,10 @@ char *dir_new_path(char *src, const char *oldname, const char *name,
/* copy text up to oldname */ /* copy text up to oldname */
retlen = strlcpy(p, src, p2 - src); retlen = strlcpy(p, src, p2 - src);
if (retlen >= p2 - src) if (retlen >= p2 - src) {
free(ret);
return NULL; return NULL;
}
/* move target pointer (p) */ /* move target pointer (p) */
p += p2 - src; p += p2 - src;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment