* lib/bitsetv.c (bitsetv_free): Do nothing when the bitsetv is NULL.
+2019-01-27 Akim Demaille <akim@lrde.epita.fr>
+
+ bitsetv: allow free on NULL.
+ * lib/bitsetv.c (bitsetv_free): Do nothing when the bitsetv is NULL.
+
2019-01-27 Bruno Haible <bruno@clisp.org>
test-framework-sh: Improve maintainability.
void
bitsetv_free (bitsetv bsetv)
{
- for (bitset_bindex i = 0; bsetv[i]; i++)
- BITSET_FREE_ (bsetv[i]);
- free (bsetv);
+ if (bsetv)
+ {
+ for (bitset_bindex i = 0; bsetv[i]; i++)
+ BITSET_FREE_ (bsetv[i]);
+ free (bsetv);
+ }
}
attribute hints specified by ATTR. */
bitsetv bitsetv_create (bitset_bindex, bitset_bindex, unsigned);
-/* Free vector of bitsets. */
+/* Free vector of bitsets. Do nothing if NULL. */
void bitsetv_free (bitsetv);
/* Zero vector of bitsets. */