Skip to content

Commit

Permalink
app_python: fix of buf memory allocation size for chars
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Apr 18, 2016
1 parent 8d7c12a commit 5042f30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/app_python/python_support.c
Expand Up @@ -79,13 +79,13 @@ void python_handle_exception(const char *fmt, ...)
}

buflen = 1;
buf = (char *)pkg_realloc(NULL, buflen * sizeof(char *));
buf = (char *)pkg_realloc(NULL, buflen * sizeof(char));
if (!buf)
{
LM_ERR("python_handle_exception(): Can't allocate memory (%lu bytes), pkg_realloc() has failed. Not enough memory.\n", (unsigned long)(buflen * sizeof(char *)));
return;
}
memset(buf, 0, sizeof(char *));
memset(buf, 0, buflen * sizeof(char));

for (i = 0; i < PySequence_Size(pResult); i++) {
line = PySequence_GetItem(pResult, i);
Expand Down

0 comments on commit 5042f30

Please sign in to comment.