use xmalloc() instead of malloc()
This commit is contained in:
parent
2401ce5343
commit
d1a9d57bd6
@ -154,9 +154,7 @@ int e2p_edit_feature(const char *str, __u32 *compat_array, __u32 *ok_array)
|
|||||||
unsigned int mask;
|
unsigned int mask;
|
||||||
int compat_type;
|
int compat_type;
|
||||||
|
|
||||||
buf = malloc(strlen(str)+1);
|
buf = xmalloc(strlen(str)+1);
|
||||||
if (!buf)
|
|
||||||
return 1;
|
|
||||||
strcpy(buf, str);
|
strcpy(buf, str);
|
||||||
cp = buf;
|
cp = buf;
|
||||||
while (cp && *cp) {
|
while (cp && *cp) {
|
||||||
|
@ -99,9 +99,7 @@ int e2p_edit_mntopts(const char *str, __u32 *mntopts, __u32 ok)
|
|||||||
int neg;
|
int neg;
|
||||||
unsigned int mask;
|
unsigned int mask;
|
||||||
|
|
||||||
buf = malloc(strlen(str)+1);
|
buf = xmalloc(strlen(str)+1);
|
||||||
if (!buf)
|
|
||||||
return 1;
|
|
||||||
strcpy(buf, str);
|
strcpy(buf, str);
|
||||||
cp = buf;
|
cp = buf;
|
||||||
while (cp && *cp) {
|
while (cp && *cp) {
|
||||||
|
Loading…
Reference in New Issue
Block a user