From: Jindrich Novy Date: Thu, 25 Sep 2008 17:32:27 +0000 (+0200) Subject: Avoid segfault in rpmLeadNew() if calloc() fails X-Git-Tag: rpm-4.6.0-rc1~62 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1dd1d68afe6dc55c37f1292250f1c26a5196ea0a;p=platform%2Fupstream%2Frpm.git Avoid segfault in rpmLeadNew() if calloc() fails --- diff --git a/lib/rpmlead.c b/lib/rpmlead.c index 805606a..8bb8779 100644 --- a/lib/rpmlead.c +++ b/lib/rpmlead.c @@ -41,7 +41,7 @@ struct rpmlead_s { rpmlead rpmLeadNew(void) { int archnum, osnum; - rpmlead l = calloc(1, sizeof(*l)); + rpmlead l = xcalloc(1, sizeof(*l)); rpmGetArchInfo(NULL, &archnum); rpmGetOsInfo(NULL, &osnum);