- do not grow whatprovides if it is not allocated
authorStefan Schubert <schubi@suse.de>
Thu, 21 Feb 2008 16:10:43 +0000 (16:10 +0000)
committerStefan Schubert <schubi@suse.de>
Thu, 21 Feb 2008 16:10:43 +0000 (16:10 +0000)
src/poolid.c

index 4cc9a24..0fcb75f 100644 (file)
@@ -28,7 +28,7 @@ str2id(Pool *pool, const char *str, int create)
 {
   int oldnstrings = pool->ss.nstrings;
   Id id = stringpool_str2id (&pool->ss, str, create);
-  if (create && oldnstrings != pool->ss.nstrings && (id & WHATPROVIDES_BLOCK) == 0)
+  if (create && pool->whatprovides && oldnstrings != pool->ss.nstrings && (id & WHATPROVIDES_BLOCK) == 0)
     {
       /* grow whatprovides array */
       pool->whatprovides = sat_realloc(pool->whatprovides, (id + (WHATPROVIDES_BLOCK + 1)) * sizeof(Offset));
@@ -42,7 +42,7 @@ strn2id(Pool *pool, const char *str, unsigned int len, int create)
 {
   int oldnstrings = pool->ss.nstrings;
   Id id = stringpool_strn2id (&pool->ss, str, len, create);
-  if (create && oldnstrings != pool->ss.nstrings && (id & WHATPROVIDES_BLOCK) == 0)
+  if (create && pool->whatprovides && oldnstrings != pool->ss.nstrings && (id & WHATPROVIDES_BLOCK) == 0)
     {
       /* grow whatprovides array */
       pool->whatprovides = sat_realloc(pool->whatprovides, (id + (WHATPROVIDES_BLOCK + 1)) * sizeof(Offset));