aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2020-08-07 22:25:20 -0400
committerJason Woodward2020-08-07 22:25:20 -0400
commiteb1fc38a5a64aafc6402546f383929b88101a3d7 (patch)
tree1bc9bcd25dc2a8e2599a83557f29d852f3819f57
parent6abd493250d18b19ca704721f46782847d5309e4 (diff)
downloadslapt-get-eb1fc38a5a64aafc6402546f383929b88101a3d7.tar.gz
common: check for initialized in slapt_vector_t_free
-rw-r--r--src/common.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common.c b/src/common.c
index 6baabc0..8805d89 100644
--- a/src/common.c
+++ b/src/common.c
@@ -434,6 +434,9 @@ slapt_vector_t *slapt_vector_t_init(slapt_vector_t_free_function f)
void slapt_vector_t_free(slapt_vector_t *v)
{
+ if (!v)
+ return;
+
if (v->free_function) {
for (uint32_t i = 0; i < v->size; i++) {
v->free_function(v->items[i]);