]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/env.c
Remove xmalloc.c, fix potential 0-pointer derefenrence in cli.c.
[z180-stamp.git] / avr / env.c
index 4f37590e891f8cad0e65c77dc708f8b1a2c18b23..b2b4e6fd1fa0b66828cd8071060290cffffbbf8f 100644 (file)
--- a/avr/env.c
+++ b/avr/env.c
@@ -9,7 +9,6 @@
 
 #include "config.h"
 #include "debug.h"
-#include "xmalloc.h"
 #include "crc.h"
 #include "getopt-min.h"
 
@@ -195,7 +194,7 @@ int envlist_import(uint8_t flags)
                                return -1;
                }
 
-               np = (char *) xmalloc(len+1);
+               np = (char *) malloc(len+1);
                if (np == NULL) {
                        printf_P(PSTR("## Can't malloc %d bytes\n"), len+1);
                        return 1;
@@ -488,7 +487,7 @@ command_ret_t _do_env_set(uint_fast8_t flag, int argc, char * const argv[])
        for (i = 2, len += 1; i < argc; ++i)
                len += strlen(argv[i]) + 1;
 
-       value = xmalloc(len);
+       value = malloc(len);
        if (value == NULL) {
                printf_P(PSTR("## Can't malloc %d bytes\n"), len);
                return CMD_RET_FAILURE;