diff options
Diffstat (limited to 'lib/libmtd_legacy.c')
-rw-r--r-- | lib/libmtd_legacy.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/libmtd_legacy.c b/lib/libmtd_legacy.c index 3d129c1..7488275 100644 --- a/lib/libmtd_legacy.c +++ b/lib/libmtd_legacy.c @@ -75,12 +75,7 @@ static int proc_parse_start(struct proc_parse_info *pi) if (fd == -1) return -1; - pi->buf = malloc(PROC_MTD_MAX_LEN); - if (!pi->buf) { - sys_errmsg("cannot allocate %d bytes of memory", - PROC_MTD_MAX_LEN); - goto out_close; - } + pi->buf = xmalloc(PROC_MTD_MAX_LEN); ret = read(fd, pi->buf, PROC_MTD_MAX_LEN); if (ret == -1) { @@ -103,7 +98,6 @@ static int proc_parse_start(struct proc_parse_info *pi) out_free: free(pi->buf); -out_close: close(fd); return -1; } |