]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[libdingaling] Fix memory leaks
authorAndrey Volk <andywolk@gmail.com>
Tue, 6 Apr 2021 16:16:23 +0000 (19:16 +0300)
committerAndrey Volk <andywolk@gmail.com>
Tue, 19 Oct 2021 17:19:25 +0000 (20:19 +0300)
libs/libdingaling/src/libdingaling.c

index 6fbedfda6edb4fe969449c8b8b183b62a48a200e..ee08f041c0e354ab4c1f9f246f8fba19cf44c3ca 100644 (file)
@@ -1297,6 +1297,8 @@ static int on_subscribe(void *user_data, ikspak *pak)
                handle->session_callback(handle, NULL, LDL_SIGNAL_SUBSCRIBE, to, from, NULL, NULL);
        }
 
+       if (id) free(id);
+
        return IKS_FILTER_EAT;
 }
 
@@ -2325,6 +2327,9 @@ void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, const char
        if (strchr(my_body, '<')) {
                len = (int) strlen(my_body);
                if (!(bdup = malloc(len))) {
+                       if (my_body_base) {
+                               free(my_body_base);
+                       }
                        return;
                }