Avoid segfault in rpmLeadNew() if calloc() fails
authorJindrich Novy <jnovy@redhat.com>
Thu, 25 Sep 2008 17:32:27 +0000 (19:32 +0200)
committerJindrich Novy <jnovy@redhat.com>
Thu, 25 Sep 2008 18:03:50 +0000 (20:03 +0200)
lib/rpmlead.c

index 805606a..8bb8779 100644 (file)
@@ -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);