From: Martin Olsson Date: Sun, 8 Jul 2012 01:03:46 +0000 (+0200) Subject: wcap: Plug memory leak in wcap_decoder_create() X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9988633f5871c4dbbf6796945c528c8b468b2eed;p=profile%2Fivi%2Fweston-ivi-shell.git wcap: Plug memory leak in wcap_decoder_create() --- diff --git a/wcap/wcap-decode.c b/wcap/wcap-decode.c index 425ccff..3dc7e6d 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;