From 5aea0b6d8eaa1c58ca935154e9bb8d0147ff6d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=98yvind=20Karlsen?= Date: Fri, 29 Feb 2008 18:48:57 +0000 Subject: always initialize pointer in headerGetEntry --- rpm5compat.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rpm5compat.h b/rpm5compat.h index 5c2da10..860cc8d 100644 --- a/rpm5compat.h +++ b/rpm5compat.h @@ -58,7 +58,8 @@ static inline int headerGetEntry(Header h, int_32 tag, hTYP_t type, void ** p, h HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he)); int rc; - if (tag == RPMTAG_EPOCH) *(void **)p = NULL; + /* Always ensure to initialize */ + *(void **)p = NULL; he->tag = tag; rc = headerGet(h, he, tag); if (rc) { @@ -66,6 +67,7 @@ static inline int headerGetEntry(Header h, int_32 tag, hTYP_t type, void ** p, h if (p) *(void **) p = he->p.ptr; if (c) *c = he->c; } + return rc; } -- cgit v1.2.1