mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-04 02:18:37 +00:00
Avoid memory leak.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14429
This commit is contained in:
parent
ac8a005dd4
commit
3aa58402fa
@ -261,10 +261,14 @@ static void ddel_FileFn ( FileFn* ffn )
|
||||
|
||||
static FileFn* dopy_FileFn ( FileFn* ff )
|
||||
{
|
||||
char* fi2 = strdup(ff->fi_name);
|
||||
char* fn2 = strdup(ff->fn_name);
|
||||
if ((!fi2) || (!fn2))
|
||||
char *fi2, *fn2;
|
||||
fi2 = strdup(ff->fi_name);
|
||||
if (fi2 == NULL) return NULL;
|
||||
fn2 = strdup(ff->fn_name);
|
||||
if (fn2 == NULL) {
|
||||
free(fi2);
|
||||
return NULL;
|
||||
}
|
||||
return new_FileFn( fi2, fn2 );
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user