diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-09-23 22:38:43 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-23 22:38:43 +0200 |
commit | ef359260830b1b4cc6a386bd5697f1a198704a4c (patch) | |
tree | 93fb666c6027beba133b609d4fc787ed26bee9cd /src | |
parent | 74b34f7b6115da93a772e3c7c8da2889df4d1d91 (diff) | |
download | mpd-ef359260830b1b4cc6a386bd5697f1a198704a4c.tar.gz mpd-ef359260830b1b4cc6a386bd5697f1a198704a4c.tar.xz mpd-ef359260830b1b4cc6a386bd5697f1a198704a4c.zip |
songvec: avoid free(NULL)
Potentially broken free() implementations don't like it
Diffstat (limited to 'src')
-rw-r--r-- | src/songvec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/songvec.c b/src/songvec.c index f879830dc..3d0eaa02f 100644 --- a/src/songvec.c +++ b/src/songvec.c @@ -60,7 +60,9 @@ void songvec_add(struct songvec *sv, Song *add) void songvec_free(struct songvec *sv) { - free(sv->base); - sv->base = NULL; + if (sv->base) { + free(sv->base); + sv->base = NULL; + } sv->nr = 0; } |