[hackers] [ubase] Check strdup() for failure || sin

From: <git_AT_suckless.org>
Date: Sat, 15 Mar 2014 19:49:42 +0100

commit 861e16ac1763786dda1ce459acd33e4d9c5d6e99
Author: sin <sin_AT_2f30.org>
Date: Sat Mar 15 18:48:01 2014 +0000

    Check strdup() for failure

diff --git a/umount.c b/umount.c
index efe7d84..429ada1 100644
--- a/umount.c
+++ b/umount.c
_AT_@ -74,6 +74,8 @@ umountall(int flags)
                 if (!mntdirs)
                         eprintf("realloc:");
                 mntdirs[len - 1] = strdup(me->mnt_dir);
+ if (!mntdirs[len - 1])
+ eprintf("strdup:");
         }
         endmntent(fp);
         while (--len >= 0) {
Received on Sat Mar 15 2014 - 19:49:42 CET

This archive was generated by hypermail 2.3.0 : Sat Mar 15 2014 - 20:00:23 CET