summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbargepole <bargepole@bargepole.in.bpm>2019-09-02 11:01:19 +0100
committerbargepole <bargepole@bargepole.in.bpm>2019-09-02 11:01:19 +0100
commitaf5ecc1cf814e88039eab0826a926c6b7afb0c28 (patch)
tree56d9f6b5eb3bed739f96f00fc2058d75a5f66aa8
parent8df182e6d1eaa9a0fd6323b9b6c22f118b28acd4 (diff)
downloadqotdserver-af5ecc1cf814e88039eab0826a926c6b7afb0c28.tar.gz
qotdserver-af5ecc1cf814e88039eab0826a926c6b7afb0c28.tar.bz2
qotdserver-af5ecc1cf814e88039eab0826a926c6b7afb0c28.zip
free for mallocs in dbHEADmaster
-rw-r--r--db.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/db.c b/db.c
index a968f28..e3764d8 100644
--- a/db.c
+++ b/db.c
@@ -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
+}