aboutsummaryrefslogtreecommitdiffstats
path: root/src/androidvfs.c
diff options
context:
space:
mode:
authorPo Lu2023-10-04 16:33:05 +0800
committerPo Lu2023-10-04 16:33:05 +0800
commitbb417daa703b0dd8871470ce53a40b16b1ca300b (patch)
treee826d39aef4b622acfdc9c77a4b581dbab447fab /src/androidvfs.c
parentfbfdd1e0e3e67f765c6dbf9f61b5f913e55e004e (diff)
downloademacs-bb417daa703b0dd8871470ce53a40b16b1ca300b.tar.gz
emacs-bb417daa703b0dd8871470ce53a40b16b1ca300b.zip
Correct local reference leaks
* src/android.c (android_build_string): Accept a list of local references to destroy upon an allocation failure, facilitating the proper deallocation of local references in such situations. (android_browse_url): Revise for new calling convention. * src/android.h (android_build_string): Update declaration correspondingly. * src/androidmenu.c (android_menu_show, android_dialog_show): Revise for new calling convention. * src/androidselect.c (android_notifications_notify_1): Supply each successive local reference to android_build_string as notification text is being encoded. * src/androidvfs.c (android_saf_exception_check): Introduce absent va_end.
Diffstat (limited to 'src/androidvfs.c')
-rw-r--r--src/androidvfs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/androidvfs.c b/src/androidvfs.c
index 0e5bbf8a13e..94c5d35ed2c 100644
--- a/src/androidvfs.c
+++ b/src/androidvfs.c
@@ -3995,8 +3995,11 @@ android_saf_exception_check (int n, ...)
3995 /* First, check for an exception. */ 3995 /* First, check for an exception. */
3996 3996
3997 if (!(*env)->ExceptionCheck (env)) 3997 if (!(*env)->ExceptionCheck (env))
3998 /* No exception has taken place. Return 0. */ 3998 {
3999 return 0; 3999 /* No exception has taken place. Return 0. */
4000 va_end (ap);
4001 return 0;
4002 }
4000 4003
4001 /* Print the exception. */ 4004 /* Print the exception. */
4002 (*env)->ExceptionDescribe (env); 4005 (*env)->ExceptionDescribe (env);
@@ -4045,6 +4048,7 @@ android_saf_exception_check (int n, ...)
4045 /* expression is still a local reference! */ 4048 /* expression is still a local reference! */
4046 ANDROID_DELETE_LOCAL_REF ((jobject) exception); 4049 ANDROID_DELETE_LOCAL_REF ((jobject) exception);
4047 errno = new_errno; 4050 errno = new_errno;
4051 va_end (ap);
4048 return 1; 4052 return 1;
4049} 4053}
4050 4054