You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.3 KiB

  1. From 4135292707ef737f8fea8b255f31648bc01e3063 Mon Sep 17 00:00:00 2001
  2. From: Thierry FOURNIER <thierry.fournier@ozon.io>
  3. Date: Sat, 17 Dec 2016 11:46:06 +0100
  4. Subject: [PATCH 10/19] BUG/MINOR: lua: memory leak executing tasks
  5. The struct hlua isn't freed when the task is complete.
  6. This patch should be backported in 1.6 and 1.7
  7. (cherry picked from commit 4e7c708612730d79f4cc2ec7617fce01665ff807)
  8. ---
  9. src/hlua.c | 3 +++
  10. 1 file changed, 3 insertions(+)
  11. diff --git a/src/hlua.c b/src/hlua.c
  12. index e82656b..cdef8ed 100644
  13. --- a/src/hlua.c
  14. +++ b/src/hlua.c
  15. @@ -5133,6 +5133,7 @@ static struct task *hlua_process_task(struct task *task)
  16. /* finished or yield */
  17. case HLUA_E_OK:
  18. hlua_ctx_destroy(hlua);
  19. + free(hlua);
  20. task_delete(task);
  21. task_free(task);
  22. break;
  23. @@ -5146,6 +5147,7 @@ static struct task *hlua_process_task(struct task *task)
  24. case HLUA_E_ERRMSG:
  25. SEND_ERR(NULL, "Lua task: %s.\n", lua_tostring(hlua->T, -1));
  26. hlua_ctx_destroy(hlua);
  27. + free(hlua);
  28. task_delete(task);
  29. task_free(task);
  30. break;
  31. @@ -5154,6 +5156,7 @@ static struct task *hlua_process_task(struct task *task)
  32. default:
  33. SEND_ERR(NULL, "Lua task: unknown error.\n");
  34. hlua_ctx_destroy(hlua);
  35. + free(hlua);
  36. task_delete(task);
  37. task_free(task);
  38. break;
  39. --
  40. 2.10.2