Fix a memory leak.

Obtained from:	elftoolchain
MFC after:		1 month
This commit is contained in:
Kai Wang 2010-07-21 12:30:58 +00:00
parent e88f9fb47f
commit e2efa43644

View File

@ -855,11 +855,13 @@ _libelf_write_elf(Elf *e, off_t newsize)
e->e_u.e_elf.e_phdr.e_phdr64 = NULL;
}
free(newfile);
return (rc);
error:
if (newfile)
free(newfile);
free(newfile);
return ((off_t) -1);
}