From deedaa30537d73c8fdfbc709746ea47ab25571bf Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 17 Feb 2009 23:57:15 +0100 Subject: [PATCH] blkid: check calloc() return value Signed-off-by: Karel Zak --- libs/blkid/src/probe.c | 6 ++++++ 1 file changed, 6 insertions(+) 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]; -- 2.39.5