diff options
author | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-07-07 20:56:48 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-07-07 20:56:48 +0200 |
commit | e0b48b5fcc97b4979b32c79fe82c2fab5af89b86 (patch) | |
tree | 35dfd2bc6eaff729747ae3337f9c39f46560a066 /src/main.c | |
parent | 51edb36f6bd9d119c12ef893ecc1d3541f80b00a (diff) | |
download | pianobar-windows-e0b48b5fcc97b4979b32c79fe82c2fab5af89b86.tar.gz pianobar-windows-e0b48b5fcc97b4979b32c79fe82c2fab5af89b86.tar.bz2 pianobar-windows-e0b48b5fcc97b4979b32c79fe82c2fab5af89b86.zip |
client: Avoid segfault when PianoSearchMusic returned with an error
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -164,7 +164,10 @@ char *BarUiSelectMusicId (PianoHandle_t *ph) { lineBuf = readline ("Search for artist/title\n"); if (lineBuf != NULL && strlen (lineBuf) > 0) { - PianoSearchMusic (ph, lineBuf, &searchResult); + if (PianoSearchMusic (ph, lineBuf, &searchResult) != PIANO_RET_OK) { + free (lineBuf); + return NULL; + } if (searchResult.songs != NULL && searchResult.artists != NULL) { printf ("Is this an [a]rtist or [t]rack name? Press c to abort.\n"); read (fileno (stdin), &yesnoBuf, sizeof (yesnoBuf)); |