Skip to content

Commit

Permalink
Don't leak 'var'.
Browse files Browse the repository at this point in the history
Reported by:	clang static analyzer


git-svn-id: svn+ssh://svn.freebsd.org/base/head@287417 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
  • Loading branch information
delphij committed Sep 3, 2015
1 parent a246a21 commit 547b5be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion usr.sbin/makefs/mtree.c
Expand Up @@ -181,7 +181,7 @@ static char *
mtree_resolve(const char *spec, int *istemp)
{
struct sbuf *sb;
char *res, *var;
char *res, *var = NULL;
const char *base, *p, *v;
size_t len;
int c, error, quoted, subst;
Expand Down Expand Up @@ -284,8 +284,10 @@ mtree_resolve(const char *spec, int *istemp)
free(res);
}
free(var);
var = NULL;
}

free(var);
sbuf_finish(sb);
res = (error == 0) ? strdup(sbuf_data(sb)) : NULL;
sbuf_delete(sb);
Expand Down

0 comments on commit 547b5be

Please sign in to comment.