From: Andrey Volk Date: Thu, 21 Jan 2021 15:29:44 +0000 (+0300) Subject: [mod_pgsql] Fix memory leek in the case of an empty string of err_str in pgsql_handle... X-Git-Tag: v1.10.6^2~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c282386fdb9d8944eaf2414ec817da936c4500cb;p=thirdparty%2Ffreeswitch.git [mod_pgsql] Fix memory leek in the case of an empty string of err_str in pgsql_handle_exec_base_detailed() --- diff --git a/src/mod/databases/mod_pgsql/mod_pgsql.c b/src/mod/databases/mod_pgsql/mod_pgsql.c index e2efa5252c..f7c2983f91 100644 --- a/src/mod/databases/mod_pgsql/mod_pgsql.c +++ b/src/mod/databases/mod_pgsql/mod_pgsql.c @@ -515,6 +515,7 @@ error: err_str = pgsql_handle_get_error(handle); if (zstr(err_str)) { + switch_safe_free(err_str); if (!er) { err_str = strdup((char *)"SQL ERROR!"); } else {