From: Jaroslav Kysela Date: Fri, 8 Dec 2017 12:03:32 +0000 (+0100) Subject: uuid: fix for uuid_set_add, uuid_set_free X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bbe5029956a0f4904f3b1c20362bbf692b83ebbb;p=thirdparty%2Ftvheadend.git uuid: fix for uuid_set_add, uuid_set_free --- diff --git a/src/uuid.c b/src/uuid.c index bccab1067..e9d604bcd 100644 --- a/src/uuid.c +++ b/src/uuid.c @@ -174,6 +174,7 @@ uuid_set_add ( tvh_uuid_set_t *us, const tvh_uuid_t *u ) nu = realloc(us->us_array, sizeof(*u) * (us->us_size + us->us_alloc_chunk)); if (nu == NULL) return NULL; + us->us_array = nu; us->us_size += us->us_alloc_chunk; } nu = &us->us_array[us->us_count++]; @@ -188,6 +189,8 @@ uuid_set_free ( tvh_uuid_set_t *us ) if (us) { free(us->us_array); } + us->us_size = 0; + us->us_count = 0; } /* Destroy uuid set */