Jelajahi Sumber

app_python: fixed realloc size for local buf variables

- removed unreachable code
Daniel-Constantin Mierla 8 tahun lalu
induk
melakukan
64d3d1de13
2 mengubah file dengan 1 tambahan dan 3 penghapusan
  1. 0 2
      modules/app_python/apy_kemi.c
  2. 1 1
      modules/app_python/python_support.c

+ 0 - 2
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();
 }
 
 /**

+ 1 - 1
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."