mirror of
https://github.com/SuperBFG7/ympd
synced 2025-05-04 00:14:06 +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);
|
token = strtok(NULL, s);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
free(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mympd_idle(struct mg_mgr *s, int timeout) {
|
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);
|
len = snprintf(cover, cover_len, "/library/%s/%s", path, config.coverimage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
free(path);
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1451,7 +1453,8 @@ int mympd_put_songdetails(char *buffer, char *uri) {
|
|||||||
char cover[500];
|
char cover[500];
|
||||||
|
|
||||||
len = json_printf(&out, "{type: song_details, data: {");
|
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) {
|
if ((entity = mpd_recv_entity(mpd.conn)) != NULL) {
|
||||||
song = mpd_entity_get_song(entity);
|
song = mpd_entity_get_song(entity);
|
||||||
mympd_get_cover(uri, cover, 500);
|
mympd_get_cover(uri, cover, 500);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user