From dfb803a463610e4eec222ae4f1099114e82c7449 Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Thu, 2 May 2013 12:52:17 +0200 Subject: [PATCH] Fix memory leak in version string. --- gst-sdk/tutorials/android-tutorial-1/jni/tutorial-1.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gst-sdk/tutorials/android-tutorial-1/jni/tutorial-1.c b/gst-sdk/tutorials/android-tutorial-1/jni/tutorial-1.c index 92a3e87ec7..2da20b6788 100644 --- a/gst-sdk/tutorials/android-tutorial-1/jni/tutorial-1.c +++ b/gst-sdk/tutorials/android-tutorial-1/jni/tutorial-1.c @@ -7,7 +7,10 @@ * Java Bindings */ jstring gst_native_get_gstreamer_info (JNIEnv* env, jobject thiz) { - return (*env)->NewStringUTF(env, gst_version_string()); + char *version_utf8 = gst_version_string(); + jstring *version_jstring = (*env)->NewStringUTF(env, version_utf8); + g_free (version_utf8); + return version_jstring; } static JNINativeMethod native_methods[] = {