From: Karel Zak Date: Tue, 17 Feb 2009 22:57:15 +0000 (+0100) Subject: blkid: check calloc() return value X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=deedaa30537d73c8fdfbc709746ea47ab25571bf;p=util-linux blkid: check calloc() return value Signed-off-by: Karel Zak --- diff --git a/libs/blkid/src/probe.c b/libs/blkid/src/probe.c index 5e699096..449ee819 100644 --- a/libs/blkid/src/probe.c +++ b/libs/blkid/src/probe.c @@ -324,6 +324,9 @@ int blkid_probe_filter_types(blkid_probe pr, int flag, char *names[]) else blkid_probe_reset_filter(pr); + if (!pr->fltr) + return -1; + for (i = 0; i < ARRAY_SIZE(idinfos); i++) { int has = 0; const struct blkid_idinfo *id = idinfos[i]; @@ -372,6 +375,9 @@ int blkid_probe_filter_usage(blkid_probe pr, int flag, int usage) else blkid_probe_reset_filter(pr); + if (!pr->fltr) + return -1; + for (i = 0; i < ARRAY_SIZE(idinfos); i++) { const struct blkid_idinfo *id = idinfos[i];