Skip to content

Commit

Permalink
fix: segmentation fault loading URL track
Browse files Browse the repository at this point in the history
This commit fixes a segmentation fault upon loading an URL track.
  • Loading branch information
ThePedroo committed Apr 23, 2024
1 parent 5af9ff6 commit babaccb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/codecs.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ int coglink_parse_load_tracks(struct coglink_load_tracks *response, const char *
jsmnf_pair *data = jsmnf_find(pairs, json, "data", sizeof("data") - 1);

struct coglink_track *track_info = malloc(sizeof(struct coglink_track));
track_info->info = malloc(sizeof(struct coglink_track_info));

coglink_parse_track(track_info, data, json);

Expand Down Expand Up @@ -399,6 +400,7 @@ int coglink_parse_load_tracks(struct coglink_load_tracks *response, const char *
jsmnf_pair *track_pair = jsmnf_find_path(pairs, json, track_path, 3);

struct coglink_track *track_info = malloc(sizeof(struct coglink_track));
track_info->info = malloc(sizeof(struct coglink_track_info));

coglink_parse_track(track_info, track_pair, json);

Expand Down

0 comments on commit babaccb

Please sign in to comment.