Adding null pointer check here for safety

This commit is contained in:
Rich Geldreich
2020-03-20 02:27:33 -04:00
parent 34eeeac2e3
commit 078f6cd3ac

View File

@@ -201,6 +201,7 @@ static void uivector_init(uivector* p) {
/*returns 1 if success, 0 if failure ==> nothing done*/
static unsigned uivector_push_back(uivector* p, unsigned c) {
if(!uivector_resize(p, p->size + 1)) return 0;
if (!p->data) return 0;
p->data[p->size - 1] = c;
return 1;
}