Misplaced assert
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 21 May 2008 09:41:31 +0000 (12:41 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 21 May 2008 09:41:31 +0000 (12:41 +0300)
- we only care about non-NULL data if we're supposed to free the contents

lib/rpmtd.c

index 8948233..d1c49cf 100644 (file)
@@ -40,8 +40,8 @@ void rpmtdFreeData(rpmtd td)
     assert(td != NULL);
 
     if (td->flags & RPMTD_ALLOCED) {
-       assert(td->data != NULL);
        if (td->flags & RPMTD_PTR_ALLOCED) {
+           assert(td->data != NULL);
            char **data = td->data;
            for (int i = 0; i < td->count; i++) {
                free(data[i]);