Closed J-u-n-o closed 4 years ago
playerctl-cli.c static int handle_list_all_flag()
GList *l = NULL;
for (l = player_names_list; l != NULL; l = l->next) {
PlayerctlPlayerName *name = l->data;
if (name->instance != NULL) {
printf("%s\n", name->instance); } else { printf("[NULL]\n"); } }
playerctl-player-name.c void playerctl_player_name_free(PlayerctlPlayerName *name)
if (name == NULL) {
return;
}
if (name->instance != NULL) {
g_free(name->instance);
} if (name->name != NULL) {
g_free(name->name);
}
g_slice_free(PlayerctlPlayerName, name);
I found the issue and was able to recreate it in the testcases. I think c41c479a fixes this.
Segmentation fault Due to free-ing memory twice, and subsequent free-ing of null pointers
file: playerctl-player.c function: playerctl_list_players Original the system_players were free-ed: