[libdingaling] Fix memory leaks

This commit is contained in:
Andrey Volk 2021-04-06 19:16:23 +03:00
parent 322191a2f4
commit 7713a2470d
1 changed files with 5 additions and 0 deletions

View 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;
}