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
diff --git a/liblog/pmsg_writer.c b/liblog/pmsg_writer.c
index c1c068e..5e4ff98 100644
--- a/liblog/pmsg_writer.c
+++ b/liblog/pmsg_writer.c
@@ -285,6 +285,7 @@
                 __android_log_unlock();
             } else if (pmsgOpen() < 0) {
                 __android_log_unlock();
+                free(cp);
                 return -EBADF;
             }
         }