git.haldean.org ubik / 41f400c
fix memory leak when humanizing tuples haldean 3 years ago
1 changed file(s) with 7 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
197197 no_ignore ubik_error
198198 ubik_value_humanize(char **res, size_t *res_len, struct ubik_value *v)
199199 {
200 char *t0, *t1;
200 char *t0, *t1, *t2;
201201 size_t s;
202202 ubik_word i;
203203 ubik_error err;
233233 if (t0 == NULL)
234234 asprintf(&t0, "(%s", t1);
235235 else
236 asprintf(&t0, "%s, %s", t0, t1);
236 {
237 asprintf(&t2, "%s, %s", t0, t1);
238 free(t0);
239 t0 = t2;
240 }
237241 free(t1);
238242 }
239243 *res_len = asprintf(res, "%s)", t0);
244 free(t0);
240245 return OK;
241246
242247 case UBIK_FUN: