]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
uuid: fix for uuid_set_add, uuid_set_free
authorJaroslav Kysela <perex@perex.cz>
Fri, 8 Dec 2017 12:03:32 +0000 (13:03 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 8 Dec 2017 13:24:59 +0000 (14:24 +0100)
src/uuid.c

index bccab106792e63059647b01939b87b15c2cb1b24..e9d604bcd3df278bc09e5ecced63c4862309babb 100644 (file)
@@ -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 */