]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- fixed memory leak in error case 1157/head
authorArvin Schnell <aschnell@suse.de>
Tue, 23 Jun 2026 06:21:36 +0000 (08:21 +0200)
committerArvin Schnell <aschnell@suse.de>
Tue, 23 Jun 2026 06:21:36 +0000 (08:21 +0200)
client/proxy/commands.cc

index 699ba5297d880d22635dee466eb5fb628e574fc6..ef66e46153a6166d8eec04579093731681c1ef8b 100644 (file)
@@ -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);