Bug 967553 - Restore to using __wrap_free. r=gcp

This commit is contained in:
Jim Chen 2014-02-05 13:39:48 -05:00
parent 42e775a64c
commit ac3708bb75
2 changed files with 2 additions and 18 deletions

View File

@ -13,13 +13,6 @@
#include "ElfLoader.h" #include "ElfLoader.h"
#ifdef MOZ_MEMORY
// libc's free().
extern "C" void __real_free(void *);
#else
#define __real_free(a) free(a)
#endif
#ifdef DEBUG #ifdef DEBUG
#define LOG(x...) __android_log_print(ANDROID_LOG_INFO, "GeckoJNI", x) #define LOG(x...) __android_log_print(ANDROID_LOG_INFO, "GeckoJNI", x)
#else #else
@ -91,8 +84,7 @@ throwError(JNIEnv* jenv, const char * funcString) {
LOG("Throwing error: %s\n", msg); LOG("Throwing error: %s\n", msg);
JNI_Throw(jenv, "java/lang/Exception", msg); JNI_Throw(jenv, "java/lang/Exception", msg);
// msg is allocated by asprintf, it needs to be freed by libc. free(msg);
__real_free(msg);
LOG("Error thrown\n"); LOG("Error thrown\n");
} }

View File

@ -11,13 +11,6 @@
#include "ElfLoader.h" #include "ElfLoader.h"
#include "SQLiteBridge.h" #include "SQLiteBridge.h"
#ifdef MOZ_MEMORY
// libc's free().
extern "C" void __real_free(void *);
#else
#define __real_free(a) free(a)
#endif
#ifdef DEBUG #ifdef DEBUG
#define LOG(x...) __android_log_print(ANDROID_LOG_INFO, "GeckoJNI", x) #define LOG(x...) __android_log_print(ANDROID_LOG_INFO, "GeckoJNI", x)
#else #else
@ -85,8 +78,7 @@ static void throwSqliteException(JNIEnv* jenv, const char* aFormat, ...)
vasprintf(&msg, aFormat, ap); vasprintf(&msg, aFormat, ap);
LOG("Error in SQLiteBridge: %s\n", msg); LOG("Error in SQLiteBridge: %s\n", msg);
JNI_Throw(jenv, "org/mozilla/gecko/sqlite/SQLiteBridgeException", msg); JNI_Throw(jenv, "org/mozilla/gecko/sqlite/SQLiteBridgeException", msg);
// msg is allocated by vasprintf, it needs to be freed by libc. free(msg);
__real_free(msg);
va_end(ap); va_end(ap);
} }