aboutsummaryrefslogtreecommitdiffstats
path: root/src/androidselect.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/androidselect.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/androidselect.c')
-rw-r--r--src/androidselect.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/androidselect.c b/src/androidselect.c
index cf2265d4cf4..3f025351093 100644
--- a/src/androidselect.c
+++ b/src/androidselect.c
@@ -613,10 +613,12 @@ android_notifications_notify_1 (Lisp_Object title, Lisp_Object body,
613 (long int) (boot_time.tv_sec / 2), id); 613 (long int) (boot_time.tv_sec / 2), id);
614 614
615 /* Encode all strings into their Java counterparts. */ 615 /* Encode all strings into their Java counterparts. */
616 title1 = android_build_string (title); 616 title1 = android_build_string (title, NULL);
617 body1 = android_build_string (body); 617 body1 = android_build_string (body, title1, NULL);
618 group1 = android_build_string (group); 618 group1 = android_build_string (group, body1, title1, NULL);
619 identifier1 = android_build_jstring (identifier); 619 identifier1
620 = (*android_java_env)->NewStringUTF (android_java_env, identifier);
621 android_exception_check_3 (title1, body1, group1);
620 622
621 /* Create the notification. */ 623 /* Create the notification. */
622 notification 624 notification