Browse Source

Changed malloc/free to mem_alloc/mem_free.

Ingwie Phoenix 6 years ago
parent
commit
d3b6afc260
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/optionals/gravity_env.c

+ 2 - 2
src/optionals/gravity_env.c

@@ -64,7 +64,7 @@ bool gravity_env_set(gravity_vm *vm, gravity_value_t *args, uint16_t nargs, uint
     value_var = VALUE_AS_STRING(args[2]);
     value_var = VALUE_AS_STRING(args[2]);
 
 
     uint32_t len = key_var->alloc + value_var->alloc + 1;
     uint32_t len = key_var->alloc + value_var->alloc + 1;
-    char *buf = (char*)malloc(len);
+    char *buf = (char *)mem_alloc(vm, len);
     snprintf(buf, len, "%s=%s", key_var->s, value_var->s);
     snprintf(buf, len, "%s=%s", key_var->s, value_var->s);
 
 
     GRAVITY_DEBUG_PRINT(
     GRAVITY_DEBUG_PRINT(
@@ -75,7 +75,7 @@ bool gravity_env_set(gravity_vm *vm, gravity_value_t *args, uint16_t nargs, uint
     );
     );
 
 
     int rt = putenv(buf);
     int rt = putenv(buf);
-    free(buf);
+    mem_free(buf);
 
 
     RETURN_VALUE(VALUE_FROM_INT(rt), rindex);
     RETURN_VALUE(VALUE_FROM_INT(rt), rindex);
 }
 }