songvec: avoid free(NULL)
Potentially broken free() implementations don't like it
This commit is contained in:
parent
74b34f7b61
commit
ef35926083
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue