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

Commit 106c3e61 authored by Ting-Yuan Huang's avatar Ting-Yuan Huang
Browse files

liblog: fix a memory leak in __android_log_pmsg_file_write()

Free the strdup()-ed filename before returning error.

Test: passed clang-tidy checks
Bug: none
Change-Id: I555492cb4e50400db758f7c721647a8747874a01
parent 8eb237ad
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -285,6 +285,7 @@ LIBLOG_ABI_PRIVATE ssize_t __android_log_pmsg_file_write(
                __android_log_unlock();
            } else if (pmsgOpen() < 0) {
                __android_log_unlock();
                free(cp);
                return -EBADF;
            }
        }