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
This commit is contained in:
Ting-Yuan Huang 2017-02-07 15:53:32 -08:00
parent 8eb237ad57
commit 106c3e6189
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}
}