Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 239605ef authored by Greg Hackmann's avatar Greg Hackmann
Browse files

logd: fix LogStatistics::format freeing wrong pointer



Fixes a leak and use-after-free if a client passes in an
already-allocated target buffer (currently none do)

Change-Id: Ie20c30bd5ba31e1b6db73885bd9d2ebd7e40dc27
Signed-off-by: default avatarGreg Hackmann <ghackmann@google.com>
parent 223fc42b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -401,7 +401,7 @@ void LogStatistics::format(char **buf,
    const unsigned short spaces_total = 19;

    if (*buf) {
        free(buf);
        free(*buf);
        *buf = NULL;
    }