PQfinish(conn);
- if (pghostname)
+ if (pghostname) {
ast_free(pghostname);
- if (pgdbname)
+ }
+ if (pgdbname) {
ast_free(pgdbname);
- if (pgdbuser)
+ }
+ if (pgdbuser) {
ast_free(pgdbuser);
- if (pgpassword)
+ }
+ if (pgpassword) {
ast_free(pgpassword);
- if (pgdbport)
+ }
+ if (pgdbport) {
ast_free(pgdbport);
- if (table)
+ }
+ if (table) {
ast_free(table);
+ }
AST_RWLIST_WRLOCK(&psql_columns);
while ((current = AST_RWLIST_REMOVE_HEAD(&psql_columns, list))) {
if ((cfg = ast_config_load(config, config_flags)) == NULL || cfg == CONFIG_STATUS_FILEINVALID) {
ast_log(LOG_WARNING, "Unable to load config for PostgreSQL CDR's: %s\n", config);
return -1;
- } else if (cfg == CONFIG_STATUS_FILEUNCHANGED)
+ } else if (cfg == CONFIG_STATUS_FILEUNCHANGED) {
return 0;
+ }
if (!(var = ast_variable_browse(cfg, "global"))) {
ast_config_destroy(cfg);
tmp = ""; /* connect via UNIX-socket by default */
}
- if (pghostname)
+ if (pghostname) {
ast_free(pghostname);
+ }
if (!(pghostname = ast_strdup(tmp))) {
ast_config_destroy(cfg);
return -1;
tmp = "asteriskcdrdb";
}
- if (pgdbname)
+ if (pgdbname) {
ast_free(pgdbname);
+ }
if (!(pgdbname = ast_strdup(tmp))) {
ast_config_destroy(cfg);
return -1;
tmp = "asterisk";
}
- if (pgdbuser)
+ if (pgdbuser) {
ast_free(pgdbuser);
+ }
if (!(pgdbuser = ast_strdup(tmp))) {
ast_config_destroy(cfg);
return -1;
tmp = "";
}
- if (pgpassword)
+ if (pgpassword) {
ast_free(pgpassword);
+ }
if (!(pgpassword = ast_strdup(tmp))) {
ast_config_destroy(cfg);
return -1;
tmp = "5432";
}
- if (pgdbport)
+ if (pgdbport) {
ast_free(pgdbport);
+ }
if (!(pgdbport = ast_strdup(tmp))) {
ast_config_destroy(cfg);
return -1;
tmp = "cdr";
}
- if (table)
+ if (table) {
ast_free(table);
+ }
if (!(table = ast_strdup(tmp))) {
ast_config_destroy(cfg);
return -1;