[PATCH 1/2] ipa: Fix resource leak if we encounter an error in ipa_server_conn_read

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Daniel Willmann daniel at totalueberwachung.de
Thu Sep 15 10:56:57 UTC 2011


In case of a connection reset or protocol error we should destroy the
connection as well.
---
 src/input/ipa.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/input/ipa.c b/src/input/ipa.c
index 2441de4..c881b22 100644
--- a/src/input/ipa.c
+++ b/src/input/ipa.c
@@ -390,6 +390,7 @@ static void ipa_server_conn_read(struct ipa_server_conn *conn)
 		if (errno == EPIPE || errno == ECONNRESET) {
 			LOGP(DLINP, LOGL_ERROR, "lost connection with server\n");
 		}
+		ipa_server_conn_destroy(conn);
 		return;
 	} else if (ret == 0) {
 		LOGP(DLINP, LOGL_ERROR, "connection closed with server\n");
-- 
1.7.6.1





More information about the OpenBSC mailing list