]> git.ozlabs.org Git - petitboot/commitdiff
discover/file: Fix invalid free in replace_file
authorJeremy Kerr <jk@ozlabs.org>
Thu, 24 Oct 2013 06:05:17 +0000 (14:05 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Thu, 24 Oct 2013 06:05:17 +0000 (14:05 +0800)
We talloced tempfile, we should be freeing with talloc_free.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/file.c

index 4bad0123e12e1154975adbcc0580c0b74e930918..1bde9fb805ba906c95ca4ec24df9d1dc921994af 100644 (file)
@@ -114,7 +114,7 @@ int replace_file(const char *filename, char *buf, int len)
                rc = rename(tempfile, filename);
        }
 
                rc = rename(tempfile, filename);
        }
 
-       free(tempfile);
+       talloc_free(tempfile);
 
        fchmod(fd, 0644);
 
 
        fchmod(fd, 0644);