diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-09-23 02:04:30 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-09-23 02:04:30 -0700 |
commit | 401f568b218308a8d798d96a27248b474324ee99 (patch) | |
tree | fdb6c7f8d5eb09f023b538d2f0ee10e54cdbda26 | |
parent | 31ac18277f2789383c2f2de2edb75d604b722ecf (diff) | |
download | mpd-401f568b218308a8d798d96a27248b474324ee99.tar.gz mpd-401f568b218308a8d798d96a27248b474324ee99.tar.xz mpd-401f568b218308a8d798d96a27248b474324ee99.zip |
songvec: avoid free(NULL)
Potentially broken free() implementations don't like it
-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 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; } |