wcap: Plug memory leak in wcap_decoder_create()

dev
Martin Olsson 13 years ago committed by Kristian Høgsberg
parent 197214112c
commit 9988633f58
  1. 4
      wcap/wcap-decode.c

@ -120,8 +120,10 @@ wcap_decoder_create(const char *filename)
return NULL; return NULL;
decoder->fd = open(filename, O_RDONLY); decoder->fd = open(filename, O_RDONLY);
if (decoder->fd == -1) if (decoder->fd == -1) {
free(decoder);
return NULL; return NULL;
}
fstat(decoder->fd, &buf); fstat(decoder->fd, &buf);
decoder->size = buf.st_size; decoder->size = buf.st_size;

Loading…
Cancel
Save