diff options
author | Martin Olsson <martin@minimum.se> | 2012-07-08 03:03:46 +0200 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-07-09 17:50:46 -0400 |
commit | 9988633f5871c4dbbf6796945c528c8b468b2eed (patch) | |
tree | abc6900d1d54ae03e321a0cef089488121f386ed | |
parent | 197214112c054038c956e7ce73602a8e1edbe798 (diff) | |
download | weston-9988633f5871c4dbbf6796945c528c8b468b2eed.tar.gz |
wcap: Plug memory leak in wcap_decoder_create()
-rw-r--r-- | wcap/wcap-decode.c | 4 |
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; |