discover/file: Fix invalid free vs talloc_free
authorJeremy Kerr <jk@ozlabs.org>
Fri, 18 Oct 2013 03:34:27 +0000 (11:34 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Mon, 21 Oct 2013 11:30:08 +0000 (19:30 +0800)
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/file.c

index 0cee43b897cd59e9f50f0b20d528c470cf6dd642..4bad0123e12e1154975adbcc0580c0b74e930918 100644 (file)
@@ -103,7 +103,7 @@ int replace_file(const char *filename, char *buf, int len)
        fd = mkstemp(tempfile);
        umask(oldmask);
        if (fd < 0) {
        fd = mkstemp(tempfile);
        umask(oldmask);
        if (fd < 0) {
-               free(tempfile);
+               talloc_free(tempfile);
                return fd;
        }
 
                return fd;
        }