rem: rv = get_result(_h, _r); free_query(_h); commit_transaction(_h); return(rv);
add: free_pg_params(params); pkg_free(select); return 0;  err: if (params) free_pg_params(params); if (select) pkg_free(select); return -1;
context: int db_query(db_con_t* _h, db_key_t* _k, db_op_t* _op,	     db_val_t* _v, db_key_t* _c, int _n, int _nc,	     db_key_t _o, db_res_t** _r){	int off, rv;	if (!_c) {		off = snprintf(sql_buf, SQL_BUF_LEN,			"select * from %s ", CON_TABLE(_h));	} else {		off = snprintf(sql_buf, SQL_BUF_LEN, "select ");		off += print_columns(sql_buf + off, SQL_BUF_LEN - off, _c, _nc);		off += snprintf(sql_buf + off, SQL_BUF_LEN - off,			"from %s ", CON_TABLE(_h));	}	if (_n) {		off += snprintf(sql_buf + off, SQL_BUF_LEN - off, "where ");		off += print_where(sql_buf + off, SQL_BUF_LEN - off,			_k, _op, _v, _n);	}	if (_o) {		off += snprintf(sql_buf + off, SQL_BUF_LEN - off,			"order by %s", _o);	}	if(begin_transaction(_h, sql_buf)) return(-1);	if (submit_query(_h, sql_buf) < 0) {		LOG(L_ERR, "db_query(): Error while submitting query\n");		return -2;	}	rv = get_result(_h, _r);	free_query(_h);	commit_transaction(_h);	return(rv);}