diff options
author | Sander Vrijders <[email protected]> | 2018-05-25 17:14:49 +0200 |
---|---|---|
committer | Dimitri Staessens <[email protected]> | 2018-05-25 18:30:24 +0200 |
commit | b11972e2920a0e7641c3a84fad56cd82c093ed0c (patch) | |
tree | 38ab06f14a4c2a98b14d556ca809a1986b2d1c12 /src/tools/oping | |
parent | a1f426f464989d8d045435f1f396719d29bcbdb2 (diff) | |
download | ouroboros-b11972e2920a0e7641c3a84fad56cd82c093ed0c.tar.gz ouroboros-b11972e2920a0e7641c3a84fad56cd82c093ed0c.zip |
tools: Fix memleaks as reported by cppcheck
This fixes two memleaks which were reported by cppcheck.
Signed-off-by: Sander Vrijders <[email protected]>
Signed-off-by: Dimitri Staessens <[email protected]>
Diffstat (limited to 'src/tools/oping')
-rw-r--r-- | src/tools/oping/oping_client.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tools/oping/oping_client.c b/src/tools/oping/oping_client.c index d026a683..97e9c8d3 100644 --- a/src/tools/oping/oping_client.c +++ b/src/tools/oping/oping_client.c @@ -129,8 +129,10 @@ void * writer(void * o) if (buf == NULL) return (void *) -ENOMEM; - if (fdp == NULL) + if (fdp == NULL) { + free(buf); return (void *) -EINVAL; + } memset(buf, 0, client.size); |