[mod_pgsql,mod_mariadb] Fix scan-build warnings.

This commit is contained in:
Andrey Volk 2020-02-26 01:48:40 +04:00
parent 6decc21669
commit 456a7fa8cc
2 changed files with 6 additions and 9 deletions

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) {

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: