diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-06-11 22:37:25 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-06-11 22:37:25 +0000 |
commit | 7fde8debc450c19927b82e3434fc5d6a6dd4d35d (patch) | |
tree | ec0c844948d2fd786039f5ba39427a82e004506d /e2fsprogs/blkid/devno.c | |
parent | d1a9d57bd6d9e40fb25564f10b0bd85f0a2c1e3a (diff) |
use malloc instead of xmalloc
Diffstat (limited to 'e2fsprogs/blkid/devno.c')
-rw-r--r-- | e2fsprogs/blkid/devno.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/e2fsprogs/blkid/devno.c b/e2fsprogs/blkid/devno.c index 31aa52bb4..93a57fd86 100644 --- a/e2fsprogs/blkid/devno.c +++ b/e2fsprogs/blkid/devno.c @@ -48,11 +48,9 @@ char *blkid_strndup(const char *s, int length) if (!length) length = strlen(s); - ret = malloc(length + 1); - if (ret) { - strncpy(ret, s, length); - ret[length] = '\0'; - } + ret = xmalloc(length + 1); + strncpy(ret, s, length); + ret[length] = '\0'; return ret; } @@ -68,14 +66,8 @@ static void add_to_dirlist(const char *name, struct dir_list **list) { struct dir_list *dp; - dp = malloc(sizeof(struct dir_list)); - if (!dp) - return; + dp = xmalloc(sizeof(struct dir_list)); dp->name = blkid_strdup(name); - if (!dp->name) { - free(dp); - return; - } dp->next = *list; *list = dp; } |