From: Panu Matilainen Date: Thu, 4 Dec 2008 17:10:41 +0000 (+0200) Subject: Fix triggerconds return when no data is there (rhbz#474550) X-Git-Tag: tznext/4.11.0.1.tizen20130304~3293 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1f61d628fdd07a11aa7a84dc15a74150865e575f;p=tools%2Flibrpm-tizen.git Fix triggerconds return when no data is there (rhbz#474550) --- diff --git a/lib/tagexts.c b/lib/tagexts.c index 44d8dfc..8a60d55 100644 --- a/lib/tagexts.c +++ b/lib/tagexts.c @@ -257,9 +257,8 @@ static int triggercondsTag(Header h, rpmtd td) struct rpmtd_s nametd, indextd, flagtd, versiontd, scripttd; int hgeflags = HEADERGET_MINMEM; - td->type = RPM_STRING_ARRAY_TYPE; if (!headerGet(h, RPMTAG_TRIGGERNAME, &nametd, hgeflags)) { - return 1; + return 0; } headerGet(h, RPMTAG_TRIGGERINDEX, &indextd, hgeflags); @@ -267,6 +266,7 @@ static int triggercondsTag(Header h, rpmtd td) headerGet(h, RPMTAG_TRIGGERVERSION, &versiontd, hgeflags); headerGet(h, RPMTAG_TRIGGERSCRIPTS, &scripttd, hgeflags); + td->type = RPM_STRING_ARRAY_TYPE; td->flags = RPMTD_ALLOCED | RPMTD_PTR_ALLOCED; td->data = conds = xmalloc(sizeof(*conds) * rpmtdCount(&scripttd)); td->count = rpmtdCount(&scripttd);