cherry-pick.FILE5_28-42-g10ee4ec.pr-569-shi-yin-fix-memory-leak.patch 565 B

12345678910111213141516171819202122
  1. Subject: PR/569: Shi Yin: Fix memory leak
  2. Origin: FILE5_28-42-g10ee4ec
  3. Upstream-Author: Christos Zoulas <christos@zoulas.com>
  4. Date: Sun Sep 11 13:53:02 2016 +0000
  5. Comment: Only relevant parts of that commit were used
  6. --- a/src/apprentice.c
  7. +++ b/src/apprentice.c
  8. @@ -404,11 +404,11 @@
  9. {
  10. struct mlist *ml;
  11. - mlp->map = idx == 0 ? map : NULL;
  12. + mlp->map = NULL;
  13. if ((ml = CAST(struct mlist *, malloc(sizeof(*ml)))) == NULL)
  14. return -1;
  15. - ml->map = NULL;
  16. + ml->map = idx == 0 ? map : NULL;
  17. ml->magic = map->magic[idx];
  18. ml->nmagic = map->nmagic[idx];