Module: kamailio
Branch: master
Commit: 64d3d1de13666277e3b1bd707e05880e63fd6ccf
URL: 
https://github.com/kamailio/kamailio/commit/64d3d1de13666277e3b1bd707e05880e63fd6ccf

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2016-11-01T15:23:00+01:00

app_python: fixed realloc size for local buf variables

- removed unreachable code

---

Modified: modules/app_python/apy_kemi.c
Modified: modules/app_python/python_support.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/64d3d1de13666277e3b1bd707e05880e63fd6ccf.diff
Patch: 
https://github.com/kamailio/kamailio/commit/64d3d1de13666277e3b1bd707e05880e63fd6ccf.patch

---

diff --git a/modules/app_python/apy_kemi.c b/modules/app_python/apy_kemi.c
index 431b0d9..fd4ed7f 100644
--- a/modules/app_python/apy_kemi.c
+++ b/modules/app_python/apy_kemi.c
@@ -542,8 +542,6 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject 
*args, int idx)
                                        fname.len, fname.s);
                        return sr_kemi_apy_return_false();
        }
-
-       return sr_kemi_apy_return_false();
 }
 
 /**
diff --git a/modules/app_python/python_support.c 
b/modules/app_python/python_support.c
index fd5a4a6..28f92da 100644
--- a/modules/app_python/python_support.c
+++ b/modules/app_python/python_support.c
@@ -114,7 +114,7 @@ void python_handle_exception(const char *fmt, ...)
                msglen = strlen(msg);
                buflen += ++msglen;
 
-               buf = (char *)pkg_realloc(buf, buflen * sizeof(char *));
+               buf = (char *)pkg_realloc(buf, buflen * sizeof(char));
                if (!buf)
                {
                        LM_ERR("Can't allocate memory (%lu bytes), 
pkg_realloc() has failed."


_______________________________________________
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to