Package: libdbi / 0.9.0-5

fix_memory_leak_if_not_connected.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Description: fixed memory leak if not connected
Author: Markus Hoenicka <markus.hoenicka@mhoenicka.de>
Origin: upstream, https://sourceforge.net/p/libdbi/libdbi/ci/2846c87ad3d1aa5c919f27379b8b7f6a56881492/
Bug-Debian: https://bugs.debian.org/745980
Last-Update: 2014-09-21

---

--- libdbi-0.9.0.orig/src/dbi_main.c
+++ libdbi-0.9.0/src/dbi_main.c
@@ -588,7 +588,14 @@ int dbi_conn_disjoin_results(dbi_conn Co
 void dbi_conn_close(dbi_conn Conn) {
 	dbi_conn_t *conn = Conn;
 	
-	if (!conn || !(conn->connection)) return;
+	if (!conn) {
+	  return;
+	}
+
+	if (!(conn->connection)) {
+	  free(conn);
+	  return;
+	}
 	
 	_update_internal_conn_list(conn, -1);