mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-12 09:58:36 +00:00
Don't leak 'var'.
Reported by: clang static analyzer
This commit is contained in:
parent
7e8f566c0c
commit
65b4f27054
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=287417
@ -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;
|
||||
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user