From: Michael Schroeder Date: Thu, 22 Dec 2011 15:13:30 +0000 (+0100) Subject: - make sure pool->repos[0] is zero X-Git-Tag: BASE-SuSE-Code-12_2-Branch~223 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbadd9b603eda7da569fce14c433efb2e1324f10;p=thirdparty%2Flibsolv.git - make sure pool->repos[0] is zero --- diff --git a/src/repo.c b/src/repo.c index be9db37b..75f6f370 100644 --- a/src/repo.c +++ b/src/repo.c @@ -43,8 +43,12 @@ repo_create(Pool *pool, const char *name) pool_freewhatprovides(pool); repo = (Repo *)solv_calloc(1, sizeof(*repo)); if (!pool->nrepos) - pool->nrepos = 1; /* start with repoid 1 */ - pool->repos = (Repo **)solv_realloc2(pool->repos, pool->nrepos + 1, sizeof(Repo *)); + { + pool->nrepos = 1; /* start with repoid 1 */ + pool->repos = (Repo **)solv_calloc(2, sizeof(Repo *)); + } + else + pool->repos = (Repo **)solv_realloc2(pool->repos, pool->nrepos + 1, sizeof(Repo *)); pool->repos[pool->nrepos] = repo; pool->urepos++; repo->repoid = pool->nrepos++;