diff --git a/src/blob.c b/src/blob.c index 33d297cf..384858aa 100644 --- a/src/blob.c +++ b/src/blob.c @@ -30,7 +30,7 @@ pic_blob_new(pic_state *pic, char *dat, size_t len) struct pic_blob *bv; bv = (struct pic_blob *)pic_obj_alloc(pic, sizeof(struct pic_blob), PIC_TT_BLOB); - bv->data = strndup(dat, len); + bv->data = pic_strndup(pic, dat, len); bv->len = len; return bv; } diff --git a/src/error.c b/src/error.c index 6203a767..1f0061c5 100644 --- a/src/error.c +++ b/src/error.c @@ -131,7 +131,7 @@ pic_error_error(pic_state *pic) e = (struct pic_error *)pic_obj_alloc(pic, sizeof(struct pic_error), PIC_TT_ERROR); e->type = PIC_ERROR_OTHER; - e->msg = strdup(str); + e->msg = pic_strdup(pic, str); e->irrs = pic_list_from_array(pic, argc, argv); pic_raise(pic, pic_obj_value(e)); diff --git a/src/string.c b/src/string.c index a9cddcb1..1e3044fb 100644 --- a/src/string.c +++ b/src/string.c @@ -13,7 +13,7 @@ pic_str_new(pic_state *pic, const char *cstr, size_t len) str = (struct pic_string *)pic_obj_alloc(pic, sizeof(struct pic_string), PIC_TT_STRING); str->len = len; - str->str = strdup(cstr); + str->str = pic_strdup(pic, cstr); return str; } diff --git a/src/symbol.c b/src/symbol.c index de3847bc..62057ab7 100644 --- a/src/symbol.c +++ b/src/symbol.c @@ -31,7 +31,7 @@ pic_intern_cstr(pic_state *pic, const char *str) pic->sym_pool = pic_realloc(pic, pic->sym_pool, sizeof(const char *) * pic->scapa); } id = pic->slen++; - pic->sym_pool[id] = strdup(str); + pic->sym_pool[id] = pic_strdup(pic, str); xh_put(pic->sym_tbl, str, id); return id; }