From: Jeremy Kerr Date: Thu, 24 Oct 2013 06:05:17 +0000 (+0800) Subject: discover/file: Fix invalid free in replace_file X-Git-Tag: v1.0.0~374 X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=commitdiff_plain;h=a2d0866fc8a366700d256f0f8ae8075956057fe4;ds=inline discover/file: Fix invalid free in replace_file We talloced tempfile, we should be freeing with talloc_free. Signed-off-by: Jeremy Kerr --- diff --git a/discover/file.c b/discover/file.c index 4bad012..1bde9fb 100644 --- a/discover/file.c +++ b/discover/file.c @@ -114,7 +114,7 @@ int replace_file(const char *filename, char *buf, int len) rc = rename(tempfile, filename); } - free(tempfile); + talloc_free(tempfile); fchmod(fd, 0644);