Mark some memory leaks to be fixed
This commit is contained in:
parent
a1e9d660bd
commit
f76b060dc2
4
nncmpp.c
4
nncmpp.c
|
@ -1488,6 +1488,7 @@ app_process_action (enum action action)
|
||||||
if (g_ctx.volume >= 0)
|
if (g_ctx.volume >= 0)
|
||||||
{
|
{
|
||||||
char *volume = xstrdup_printf ("%d", MIN (100, g_ctx.volume + 10));
|
char *volume = xstrdup_printf ("%d", MIN (100, g_ctx.volume + 10));
|
||||||
|
// FIXME: if this breaks, it leaks "volume"
|
||||||
MPD_SIMPLE ("setvol", volume)
|
MPD_SIMPLE ("setvol", volume)
|
||||||
free (volume);
|
free (volume);
|
||||||
}
|
}
|
||||||
|
@ -1496,6 +1497,7 @@ app_process_action (enum action action)
|
||||||
if (g_ctx.volume >= 0)
|
if (g_ctx.volume >= 0)
|
||||||
{
|
{
|
||||||
char *volume = xstrdup_printf ("%d", MAX (0, g_ctx.volume - 10));
|
char *volume = xstrdup_printf ("%d", MAX (0, g_ctx.volume - 10));
|
||||||
|
// FIXME: if this breaks, it leaks "volume"
|
||||||
MPD_SIMPLE ("setvol", volume)
|
MPD_SIMPLE ("setvol", volume)
|
||||||
free (volume);
|
free (volume);
|
||||||
}
|
}
|
||||||
|
@ -1783,11 +1785,13 @@ current_tab_on_action (enum action action)
|
||||||
char *song;
|
char *song;
|
||||||
case ACTION_CHOOSE:
|
case ACTION_CHOOSE:
|
||||||
song = xstrdup_printf ("%d", self->item_selected);
|
song = xstrdup_printf ("%d", self->item_selected);
|
||||||
|
// FIXME: if this breaks, it leaks "volume"
|
||||||
MPD_SIMPLE ("play", song)
|
MPD_SIMPLE ("play", song)
|
||||||
free (song);
|
free (song);
|
||||||
return true;
|
return true;
|
||||||
case ACTION_DELETE:
|
case ACTION_DELETE:
|
||||||
song = xstrdup_printf ("%d", self->item_selected);
|
song = xstrdup_printf ("%d", self->item_selected);
|
||||||
|
// FIXME: if this breaks, it leaks "volume"
|
||||||
MPD_SIMPLE ("delete", song)
|
MPD_SIMPLE ("delete", song)
|
||||||
free (song);
|
free (song);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue