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 b8f978ff2b9af246e777bfb3406813234c420c4c..29f81fc703e05f0b930a2a4136b7981dfc7aaa06 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 6dbd9c29f92f1ad6358db75a4e12976c63c560aa..e2baf48dfe79893a9729b749516ebcdd3704c61e 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();
 }