Permalink
Browse files

Fix double free in case of PCM sample load error

This hard to spot bug was caught in Lionel Debroux's honggfuzz tests.
Kudos to him!

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
  • Loading branch information...
cmatsuoka committed Nov 20, 2016
1 parent 0935751 commit bd1eb5cfcd802820073504c234c3f735e96c3355
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/loaders/sample.c
View
@@ -410,6 +410,7 @@ int libxmp_load_sample(struct module_data *m, HIO_HANDLE *f, int flags, struct x
#ifndef LIBXMP_CORE_PLAYER
err2:
free(xxs->data - 4);
xxs->data = NULL; /* prevent double free in PCM load error */
#endif
err:
return -1;

0 comments on commit bd1eb5c

Please sign in to comment.