summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Williams <nico@cryptonector.com>2015-04-28 10:37:37 -0500
committerNicolas Williams <nico@cryptonector.com>2015-04-28 10:37:37 -0500
commit215b4c0fe1707bb3c2b494ccd5d25ecbc323f659 (patch)
tree90f1a377efb0a3894f2f6c33d86037086864d39f
parent89963e13707386d6b11bf9719ed5e75c9405cab4 (diff)
Use jv_mem_alloc() in compile.c (fix #771)
-rw-r--r--compile.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/compile.c b/compile.c
index 3aad4ab3..4aa2d211 100644
--- a/compile.c
+++ b/compile.c
@@ -365,19 +365,19 @@ block block_bind_library(block binder, block body, int bindflags, const char* li
bindflags |= OP_HAS_BINDING;
int nrefs = 0;
int matchlen = strlen(libname);
- char* matchname = calloc(1,matchlen+2+1);
+ char* matchname = jv_mem_alloc(matchlen+2+1);
if (libname[0] != '\0') {
strcpy(matchname,libname);
- strcpy(matchname+matchlen,"::");
+ strcpy(matchname+matchlen, "::");
matchlen += 2;
}
assert(block_has_only_binders(binder, bindflags));
for (inst *curr = binder.first; curr; curr = curr->next) {
int bindflags2 = bindflags;
char* cname = curr->symbol;
- char* tname = malloc(strlen(curr->symbol)+matchlen+1);
+ char* tname = jv_mem_alloc(strlen(curr->symbol)+matchlen+1);
strcpy(tname, matchname);
- strcpy(tname+matchlen,cname);
+ strcpy(tname+matchlen, curr->symbol);
// Ew
if ((opcode_describe(curr->op)->flags & (OP_HAS_VARIABLE | OP_HAS_CONSTANT)))