From: Arvin Schnell Date: Tue, 23 Jun 2026 06:21:36 +0000 (+0200) Subject: - fixed memory leak in error case X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=8a66bbfe557551441ea8dec95e12d101e7bd970e;p=thirdparty%2Fsnapper.git - fixed memory leak in error case --- diff --git a/client/proxy/commands.cc b/client/proxy/commands.cc index 699ba529..ef66e461 100644 --- a/client/proxy/commands.cc +++ b/client/proxy/commands.cc @@ -569,6 +569,7 @@ command_get_xfiles_by_pipe(DBus::Connection& conn, const string& config_name, un if (fin.eof() != 0) break; + free(buffer); SN_THROW(IOErrorException("reading pipe failed, getline failed: " + stringerror(errno))); } @@ -579,7 +580,10 @@ command_get_xfiles_by_pipe(DBus::Connection& conn, const string& config_name, un string::size_type pos1 = line.find(" "); if (pos1 == string::npos) + { + free(buffer); SN_THROW(IOErrorException("reading pipe failed, parse error")); + } string::size_type pos2 = line.find(" ", pos1 + 1);