pkg: ensure we actually have a package object before caching it

pull/48/head
William Pitcock 2013-02-25 08:47:37 -06:00
parent c0f0cb659c
commit a3d25fe930
1 changed files with 1 additions and 1 deletions

2
pkg.c
View File

@ -493,7 +493,7 @@ pkg_find(const char *name, unsigned int flags)
#endif
out:
if (!(flags & PKGF_NO_CACHE))
if (pkg != NULL && !(flags & PKGF_NO_CACHE))
{
pkg->next = pkg_cache;
pkg_cache = pkg;