diff options
author | bargepole <bargepole@bargepole.in.bpm> | 2019-09-02 11:01:19 +0100 |
---|---|---|
committer | bargepole <bargepole@bargepole.in.bpm> | 2019-09-02 11:01:19 +0100 |
commit | af5ecc1cf814e88039eab0826a926c6b7afb0c28 (patch) | |
tree | 56d9f6b5eb3bed739f96f00fc2058d75a5f66aa8 | |
parent | 8df182e6d1eaa9a0fd6323b9b6c22f118b28acd4 (diff) | |
download | qotdserver-af5ecc1cf814e88039eab0826a926c6b7afb0c28.tar.gz qotdserver-af5ecc1cf814e88039eab0826a926c6b7afb0c28.tar.bz2 qotdserver-af5ecc1cf814e88039eab0826a926c6b7afb0c28.zip |
-rw-r--r-- | db.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -58,7 +58,7 @@ int db_connect(Config *c) { c->db_pass ); db = PQconnectdb(connection_string); - + free(connection_string); if (PQstatus(db) != CONNECTION_OK) { char *template = "Connection to database failed: %s\n"; char *message = PQerrorMessage(db); @@ -66,8 +66,10 @@ int db_connect(Config *c) { sprintf(error, template, message); write_log(error); clean_db(); + free(error); return 0; } + return 1; } @@ -109,4 +111,4 @@ char *get_quote(Config *c) { } return today_quote; } -}
\ No newline at end of file +} |