summaryrefslogtreecommitdiffstats
path: root/libblkid/src/tag.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/tag.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/tag.c')
-rw-r--r--libblkid/src/tag.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libblkid/src/tag.c b/libblkid/src/tag.c
index 9dbacef04..5b1f356bf 100644
--- a/libblkid/src/tag.c
+++ b/libblkid/src/tag.c
@@ -283,6 +283,11 @@ extern blkid_tag_iterate blkid_tag_iterate_begin(blkid_dev dev)
{
blkid_tag_iterate iter;
+ if (!dev) {
+ errno = EINVAL;
+ return NULL;
+ }
+
iter = malloc(sizeof(struct blkid_struct_tag_iterate));
if (iter) {
iter->magic = TAG_ITERATE_MAGIC;