The value may only be used until PGresult was destroyed, thus it needs
to be copied.
}
efree(querystr);
- if ((table_name = PQgetvalue(tmp_res, 0, 0)) == NULL) {
+ if (1 == PQgetisnull(tmp_res, 0, 0) || (table_name = PQgetvalue(tmp_res, 0, 0)) == NULL) {
PQclear(tmp_res);
return 0;
}
+ table_name = estrdup(table_name);
+
PQclear(tmp_res);
return table_name;
}
table_name = pdo_pgsql_translate_oid_to_table(table_oid, S->H->server);
if (table_name) {
add_assoc_string(return_value, "table", table_name);
+ efree(table_name);
}
switch (S->cols[colno].pgsql_type) {