summaryrefslogtreecommitdiff
path: root/src/poolid.c
diff options
context:
space:
mode:
authorStefan Schubert <schubi@suse.de>2008-02-21 16:10:43 +0000
committerStefan Schubert <schubi@suse.de>2008-02-21 16:10:43 +0000
commit3b07a374da0bc08c5192b22146c5f1eba4ede21e (patch)
treeb08a25babd6084f3883e9511441047bf6e47bc36 /src/poolid.c
parent67b314273adc4668b3bd19eeece7408d8bc2bf08 (diff)
downloadlibsolv-3b07a374da0bc08c5192b22146c5f1eba4ede21e.tar.gz
libsolv-3b07a374da0bc08c5192b22146c5f1eba4ede21e.tar.bz2
libsolv-3b07a374da0bc08c5192b22146c5f1eba4ede21e.zip
- do not grow whatprovides if it is not allocated
Diffstat (limited to 'src/poolid.c')
-rw-r--r--src/poolid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/poolid.c b/src/poolid.c
index 4cc9a24..0fcb75f 100644
--- a/src/poolid.c
+++ b/src/poolid.c
@@ -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));