summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Olsson <martin@minimum.se>2012-07-08 03:03:46 +0200
committerKristian Høgsberg <krh@bitplanet.net>2012-07-09 17:50:46 -0400
commit9988633f5871c4dbbf6796945c528c8b468b2eed (patch)
treeabc6900d1d54ae03e321a0cef089488121f386ed
parent197214112c054038c956e7ce73602a8e1edbe798 (diff)
downloadweston-9988633f5871c4dbbf6796945c528c8b468b2eed.tar.gz
wcap: Plug memory leak in wcap_decoder_create()
-rw-r--r--wcap/wcap-decode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/wcap/wcap-decode.c b/wcap/wcap-decode.c
index 425ccff1..3dc7e6d7 100644
--- a/wcap/wcap-decode.c
+++ b/wcap/wcap-decode.c
@@ -120,8 +120,10 @@ wcap_decoder_create(const char *filename)
return NULL;
decoder->fd = open(filename, O_RDONLY);
- if (decoder->fd == -1)
+ if (decoder->fd == -1) {
+ free(decoder);
return NULL;
+ }
fstat(decoder->fd, &buf);
decoder->size = buf.st_size;