[sr-dev] git:4.4:2c650622: erlang: fix memory leak in debug macro

Seudin Kasumovic seudin.kasumovic at gmail.com
Wed Apr 20 12:07:49 CEST 2016


Module: kamailio
Branch: 4.4
Commit: 2c650622cf7cd37dc1c5177ad314681113ac324d
URL: https://github.com/kamailio/kamailio/commit/2c650622cf7cd37dc1c5177ad314681113ac324d

Author: Seudin Kasumovic <seudin.kasumovic at gmail.com>
Committer: Seudin Kasumovic <seudin.kasumovic at gmail.com>
Date: 2016-04-20T12:06:48+02:00

erlang: fix memory leak in debug macro

- free temporary used encoding buffer

(cherry picked from commit 2b11990929ae1d097bfb66848136bd247130263b)

---

Modified: modules/erlang/erl_helpers.h

---

Diff:  https://github.com/kamailio/kamailio/commit/2c650622cf7cd37dc1c5177ad314681113ac324d.diff
Patch: https://github.com/kamailio/kamailio/commit/2c650622cf7cd37dc1c5177ad314681113ac324d.patch

---

diff --git a/modules/erlang/erl_helpers.h b/modules/erlang/erl_helpers.h
index 2aed063..fa8fdc5 100644
--- a/modules/erlang/erl_helpers.h
+++ b/modules/erlang/erl_helpers.h
@@ -141,6 +141,7 @@ do { \
 	ei_s_print_term(&pbuf, pidbuf.buff, &i); \
 	ei_x_print_reg_msg(buf, pbuf, send); \
 	free(pbuf); \
+	ei_x_free(&pidbuf); \
 } while(0)
 
 int ei_decode_strorbin(char *buf, int *index, int maxlen, char *dst);




More information about the sr-dev mailing list