[Android] Fix leak in media object conversion

Geoffrey Métais git at videolan.org
Tue Oct 23 14:33:36 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Oct 23 14:32:43 2018 +0200| [0c43b5ee5655eab3a778296b50c48bf287c4ee5e] | committer: Geoffrey Métais

Fix leak in media object conversion

> https://code.videolan.org/videolan/vlc-android/commit/0c43b5ee5655eab3a778296b50c48bf287c4ee5e
---

 medialibrary/jni/utils.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/medialibrary/jni/utils.cpp b/medialibrary/jni/utils.cpp
index 421707d06..f4eb51bf9 100644
--- a/medialibrary/jni/utils.cpp
+++ b/medialibrary/jni/utils.cpp
@@ -94,6 +94,8 @@ mediaToMediaWrapper(JNIEnv* env, fields *fields, medialibrary::MediaPtr const& m
         env->DeleteLocalRef(mrl);
     if (thumbnail != NULL)
         env->DeleteLocalRef(thumbnail);
+    if (filename != NULL)
+        env->DeleteLocalRef(filename);
     return item;
 }
 



More information about the Android mailing list