read_write_all: fix leak in tests.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 23 Aug 2011 02:51:10 +0000 (12:21 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 23 Aug 2011 02:51:10 +0000 (12:21 +0930)
ccan/read_write_all/test/run-read_all.c
ccan/read_write_all/test/run-write_all.c

index b8f978f..29f81fc 100644 (file)
@@ -71,5 +71,6 @@ int main(int argc, char *argv[])
        ok(WIFEXITED(status) && WEXITSTATUS(status) == 0,
           "WIFEXITED(status) = %u, WEXITSTATUS(status) = %u",
           WIFEXITED(status), WEXITSTATUS(status));
+       free(buffer);
        return exit_status();
 }
index 6dbd9c2..e2baf48 100644 (file)
@@ -62,6 +62,7 @@ int main(int argc, char *argv[])
        write_return = BUFSZ;
        ok1(write_all(100, buffer, BUFSZ));
        ok1(errno == 0);
+       free(buffer);
 
        return exit_status();
 }