Merge pull request #434 from signalwire/databases

[mod_pgsql,mod_mariadb] Fix scan-build warnings.
This commit is contained in:
Andrey Volk
2020-02-26 23:55:37 +04:00
committed by GitHub
2 changed files with 6 additions and 9 deletions
+3 -8
View File
@@ -685,15 +685,10 @@ error:
err_str = mariadb_handle_get_error(handle);
if (zstr(err_str)) {
if (zstr(er)) {
err_str = strdup((char *)"SQL ERROR!");
} else {
err_str = er;
}
switch_safe_free(err_str);
err_str = (er) ? er : strdup((char *)"SQL ERROR!");
} else {
if (!zstr(er)) {
free(er);
}
switch_safe_free(er);
}
if (err_str) {
+3 -1
View File
@@ -565,7 +565,9 @@ switch_status_t database_handle_exec_string(switch_database_interface_handle_t *
goto error;
}
if (result) {
if (!result) {
goto done;
} else {
switch (result->status) {
#if POSTGRESQL_MAJOR_VERSION >= 9 && POSTGRESQL_MINOR_VERSION >= 2
case PGRES_SINGLE_TUPLE: