summaryrefslogtreecommitdiffstats
path: root/libblkid/src/dev.c
diff options
context:
space:
mode:
authorKarel Zak2013-03-15 14:23:04 +0100
committerKarel Zak2013-03-15 14:59:02 +0100
commit2bb7a706a19b3473b06c2f365994660c89c4bc87 (patch)
tree8846e3c0e23d5ab4d5e5d9e285ace1523be2fbd9 /libblkid/src/dev.c
parentbuild-sys: inform gtk-doc about __ul_attribute__ (diff)
downloadkernel-qcow2-util-linux-2bb7a706a19b3473b06c2f365994660c89c4bc87.tar.gz
kernel-qcow2-util-linux-2bb7a706a19b3473b06c2f365994660c89c4bc87.tar.xz
kernel-qcow2-util-linux-2bb7a706a19b3473b06c2f365994660c89c4bc87.zip
libblkid: clean up header file
* don't teach people C by header files, so use warn_unused_result attribute only on places where we return allocated memory (to avoid leaks in applications). Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid/src/dev.c')
-rw-r--r--libblkid/src/dev.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libblkid/src/dev.c b/libblkid/src/dev.c
index 62dfc24d3..9180e4823 100644
--- a/libblkid/src/dev.c
+++ b/libblkid/src/dev.c
@@ -129,6 +129,11 @@ extern blkid_dev_iterate blkid_dev_iterate_begin(blkid_cache cache)
{
blkid_dev_iterate iter;
+ if (!cache) {
+ errno = EINVAL;
+ return NULL;
+ }
+
iter = malloc(sizeof(struct blkid_struct_dev_iterate));
if (iter) {
iter->magic = DEV_ITERATE_MAGIC;