• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/corennnnn


Commit MetaInfo

Revision6866f143bf855d796887b2f8ee8752f09a7516d6 (tree)
Time2016-09-30 07:51:44
AuthorLinux Build Service Account <lnxbuild@loca...>
CommiterGerrit - the friendly Code Review server

Log Message

Merge "Fix a memory leak in logcat binary"

Change Summary

Incremental Difference

--- a/logcat/logcat.cpp
+++ b/logcat/logcat.cpp
@@ -169,10 +169,17 @@ static void writeEntryToLogDump(AndroidLogEntry *entry)
169169 {
170170 int bytesWrittenToLogDump = 0;
171171 char defaultBuffer[512];
172+ char *outBuffer = NULL;
172173 size_t logLength;
173174
174175 // Get logLength
175- android_log_formatLogLine(g_logformat, defaultBuffer,sizeof(defaultBuffer), entry, &logLength);
176+ outBuffer = android_log_formatLogLine(g_logformat, defaultBuffer,
177+ sizeof(defaultBuffer),
178+ entry,
179+ &logLength);
180+ if (outBuffer != defaultBuffer) {
181+ free(outBuffer);
182+ }
176183
177184 // Check if the to-be-inserted log exceeds the available buffer size; And rotate if needed.
178185 checkAndRotateLogDump(logLength);