]> err.no Git - util-linux/commitdiff
blkid: check calloc() return value
authorKarel Zak <kzak@redhat.com>
Tue, 17 Feb 2009 22:57:15 +0000 (23:57 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 17 Feb 2009 22:57:15 +0000 (23:57 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libs/blkid/src/probe.c

index 5e69909619f53c4cb8ef56b0fedd04dc2fa97e62..449ee819f31625c01d8d1a80090c4c20d9f121a3 100644 (file)
@@ -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];