aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-09-23 02:04:30 -0700
committerEric Wong <normalperson@yhbt.net>2008-09-23 02:04:30 -0700
commit401f568b218308a8d798d96a27248b474324ee99 (patch)
treefdb6c7f8d5eb09f023b538d2f0ee10e54cdbda26 /src
parent31ac18277f2789383c2f2de2edb75d604b722ecf (diff)
downloadmpd-401f568b218308a8d798d96a27248b474324ee99.tar.gz
mpd-401f568b218308a8d798d96a27248b474324ee99.tar.xz
mpd-401f568b218308a8d798d96a27248b474324ee99.zip
songvec: avoid free(NULL)
Potentially broken free() implementations don't like it
Diffstat (limited to 'src')
-rw-r--r--src/songvec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/songvec.c b/src/songvec.c
index d416573ce..842e7afcd 100644
--- a/src/songvec.c
+++ b/src/songvec.c
@@ -61,8 +61,10 @@ 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;
}