From 401f568b218308a8d798d96a27248b474324ee99 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 23 Sep 2008 02:04:30 -0700 Subject: songvec: avoid free(NULL) Potentially broken free() implementations don't like it --- src/songvec.c | 6 ++++-- 1 file 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; } -- cgit v1.2.3