Compare commits

...

3 Commits

Author SHA1 Message Date
Naveen Albert
3fe8e85617 app_adsiprog: Fix possible NULL dereference.
get_token can return NULL, but process_token uses this result without
checking for NULL; as elsewhere, check for a NULL result to avoid
possible NULL dereference.

Resolves: #1419
2025-09-11 15:25:34 +00:00
Nathan Monfils
1657ccfc68 manager.c: Fix presencestate object leak
ast_presence_state allocates subtype and message. We straightforwardly
need to clean those up.
2025-09-11 15:24:01 +00:00
Sean Bright
d274905fa5 audiohook.c: Ensure correct AO2 reference is dereffed.
Part of #1440.
2025-09-11 14:47:33 +00:00
3 changed files with 8 additions and 2 deletions

View File

@@ -848,7 +848,10 @@ static int onevent(char *buf, char *name, int id, char *args, struct adsi_script
return 0;
}
/* Process 'in' things */
tok = get_token(&args, script, lineno);
if (!(tok = get_token(&args, script, lineno))) {
ast_log(LOG_WARNING, "Missing state name at line %d of %s\n", lineno, script);
return 0;
}
if (process_token(sname, tok, sizeof(sname), ARG_STRING)) {
ast_log(LOG_WARNING, "'%s' is not a valid state name at line %d of %s\n", tok, lineno, script);
return 0;

View File

@@ -632,7 +632,7 @@ void ast_audiohook_detach_list(struct ast_audiohook_list *audiohook_list)
}
if (audiohook_list->out_translate[i].trans_pvt) {
ast_translator_free_path(audiohook_list->out_translate[i].trans_pvt);
ao2_cleanup(audiohook_list->in_translate[i].format);
ao2_cleanup(audiohook_list->out_translate[i].format);
}
}

View File

@@ -5524,6 +5524,9 @@ static int action_presencestate(struct mansession *s, const struct message *m)
}
astman_append(s, "\r\n");
ast_free(subtype);
ast_free(message);
return 0;
}