command.c: remove unnecessary strdup()

git-svn-id: https://svn.musicpd.org/mpd/trunk@3924 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Eric Wong
2006-03-16 06:41:45 +00:00
parent 867ca276ad
commit 97e355e362

View File

@@ -237,13 +237,13 @@ int commandStatus(FILE * fp, unsigned int * permission, int argArrayLength,
playPlaylistIfPlayerStopped(); playPlaylistIfPlayerStopped();
switch(getPlayerState()) { switch(getPlayerState()) {
case PLAYER_STATE_STOP: case PLAYER_STATE_STOP:
state = strdup(COMMAND_STOP); state = COMMAND_STOP;
break; break;
case PLAYER_STATE_PAUSE: case PLAYER_STATE_PAUSE:
state = strdup(COMMAND_PAUSE); state = COMMAND_PAUSE;
break; break;
case PLAYER_STATE_PLAY: case PLAYER_STATE_PLAY:
state = strdup(COMMAND_PLAY); state = COMMAND_PLAY;
break; break;
} }
@@ -277,8 +277,6 @@ int commandStatus(FILE * fp, unsigned int * permission, int argArrayLength,
myfprintf(fp,"%s: %s\n",COMMAND_STATUS_ERROR,getPlayerErrorStr()); myfprintf(fp,"%s: %s\n",COMMAND_STATUS_ERROR,getPlayerErrorStr());
} }
free(state);
return 0; return 0;
} }