[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] branch master updated: fix use-after-free in postg
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] branch master updated: fix use-after-free in postgres error message |
Date: |
Sat, 11 Feb 2017 16:42:39 +0100 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new de34229c6 fix use-after-free in postgres error message
de34229c6 is described below
commit de34229c6d0470a1f54aafffb778d72c2e5d9c39
Author: Florian Dold <address@hidden>
AuthorDate: Sat Feb 11 16:41:58 2017 +0100
fix use-after-free in postgres error message
---
src/postgres/postgres.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/postgres/postgres.c b/src/postgres/postgres.c
index 4798c129d..14095c5a4 100644
--- a/src/postgres/postgres.c
+++ b/src/postgres/postgres.c
@@ -182,22 +182,22 @@ GNUNET_POSTGRES_connect (const struct
GNUNET_CONFIGURATION_Handle * cfg,
&conninfo))
conninfo = NULL;
dbh = PQconnectdb (conninfo == NULL ? "" : conninfo);
- GNUNET_free_non_null (conninfo);
- if (NULL == dbh)
- {
- /* FIXME: warn about out-of-memory? */
- return NULL;
- }
- if (PQstatus (dbh) != CONNECTION_OK)
+
+ if (NULL != dbh)
{
- GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR,
- "postgres",
- _("Unable to connect to Postgres database '%s': %s\n"),
- conninfo,
- PQerrorMessage (dbh));
- PQfinish (dbh);
- return NULL;
+ if (PQstatus (dbh) != CONNECTION_OK)
+ {
+ GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR,
+ "postgres",
+ _("Unable to connect to Postgres database '%s': %s\n"),
+ conninfo,
+ PQerrorMessage (dbh));
+ PQfinish (dbh);
+ dbh = NULL;
+ }
}
+ // FIXME: warn about out-of-memory when dbh is NULL?
+ GNUNET_free_non_null (conninfo);
return dbh;
}
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [gnunet] branch master updated: fix use-after-free in postgres error message,
gnunet <=