summaryrefslogtreecommitdiff
path: root/src/tools/operf/operf_client.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2018-05-25 17:14:49 +0200
committerDimitri Staessens <dimitri.staessens@ugent.be>2018-05-25 18:30:24 +0200
commitb11972e2920a0e7641c3a84fad56cd82c093ed0c (patch)
tree38ab06f14a4c2a98b14d556ca809a1986b2d1c12 /src/tools/operf/operf_client.c
parenta1f426f464989d8d045435f1f396719d29bcbdb2 (diff)
downloadouroboros-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 <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Diffstat (limited to 'src/tools/operf/operf_client.c')
-rw-r--r--src/tools/operf/operf_client.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tools/operf/operf_client.c b/src/tools/operf/operf_client.c
index 1518bdf5..d299e239 100644
--- a/src/tools/operf/operf_client.c
+++ b/src/tools/operf/operf_client.c
@@ -100,8 +100,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);