summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2013-10-25 10:30:23 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2013-11-01 10:46:43 +0100
commit2ca0296a824d12bc55e3d4d0bf580f26a10eb830 (patch)
tree8978e1abaa8b6593546c4af846e7032bf388f7ad
parentc38a10bca63e4fea5573dccf4caa9d17e325a6d8 (diff)
libshouldbeinlibc: fix error handling in maptime_map
Found using the Clang Static Analyzer. * libshouldbeinlibc/maptime.c (maptime_map): Fix error handling.
-rw-r--r--libshouldbeinlibc/maptime.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libshouldbeinlibc/maptime.c b/libshouldbeinlibc/maptime.c
index bc750458..cacf4b6f 100644
--- a/libshouldbeinlibc/maptime.c
+++ b/libshouldbeinlibc/maptime.c
@@ -47,6 +47,8 @@ maptime_map (int use_mach_dev, char *dev_name,
{
err = device_open (device_master, 0, dev_name ?: "time", &device);
mach_port_deallocate (mach_task_self (), device_master);
+ if (err)
+ return err;
}
err = device_map (device, VM_PROT_READ, 0, sizeof *mtime, &memobj, 0);