mirror of
https://github.com/SuperBFG7/ympd
synced 2025-03-04 02:28:19 +00:00
Fix: free unused memory
This commit is contained in:
parent
7dbf1d0262
commit
9458d483cf
@ -731,6 +731,7 @@ void mympd_mpd_features() {
|
||||
token = strtok(NULL, s);
|
||||
}
|
||||
printf("\n");
|
||||
free(str);
|
||||
}
|
||||
|
||||
void mympd_idle(struct mg_mgr *s, int timeout) {
|
||||
@ -1399,6 +1400,7 @@ int mympd_get_cover(const char *uri, char *cover, int cover_len) {
|
||||
len = snprintf(cover, cover_len, "/library/%s/%s", path, config.coverimage);
|
||||
}
|
||||
}
|
||||
free(path);
|
||||
return len;
|
||||
}
|
||||
|
||||
@ -1451,7 +1453,8 @@ int mympd_put_songdetails(char *buffer, char *uri) {
|
||||
char cover[500];
|
||||
|
||||
len = json_printf(&out, "{type: song_details, data: {");
|
||||
mpd_send_list_all_meta(mpd.conn, uri);
|
||||
if (!mpd_send_list_all_meta(mpd.conn, uri))
|
||||
RETURN_ERROR_AND_RECOVER("mpd_send_list_all_meta");
|
||||
if ((entity = mpd_recv_entity(mpd.conn)) != NULL) {
|
||||
song = mpd_entity_get_song(entity);
|
||||
mympd_get_cover(uri, cover, 500);
|
||||
|
Loading…
x
Reference in New Issue
Block a user