aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-30 12:18:32 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-04-30 12:18:32 +0800
commit0f7a8258f041454b7b15ee434940a2028f5c3a82 (patch)
treefeecfd35316d03597c27592037bd9c3f1a995a7c
parent2aa7f109391bdc18dbf703494b7161f50b039518 (diff)
[vty] Move some allocations into the context of the vty.
-rw-r--r--openbsc/src/vty/vty.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/openbsc/src/vty/vty.c b/openbsc/src/vty/vty.c
index 66e7d05d..8455b0e3 100644
--- a/openbsc/src/vty/vty.c
+++ b/openbsc/src/vty/vty.c
@@ -54,7 +54,7 @@ struct vty *vty_new()
new->obuf = buffer_new(0); /* Use default buffer size. */
if (!new->obuf)
goto out_new;
- new->buf = _talloc_zero(tall_vty_ctx, VTY_BUFSIZ, "vty_new->buf");
+ new->buf = _talloc_zero(new, VTY_BUFSIZ, "vty_new->buf");
if (!new->buf)
goto out_obuf;
@@ -210,7 +210,7 @@ int vty_out(struct vty *vty, const char *format, ...)
else
size = size * 2;
- p = talloc_realloc_size(tall_vty_ctx, p, size);
+ p = talloc_realloc_size(vty, p, size);
if (!p)
return -1;
@@ -357,7 +357,7 @@ static void vty_ensure(struct vty *vty, int length)
{
if (vty->max <= length) {
vty->max *= 2;
- vty->buf = talloc_realloc_size(tall_vty_ctx, vty->buf, vty->max);
+ vty->buf = talloc_realloc_size(vty, vty->buf, vty->max);
// FIXME: check return
}
}
@@ -458,7 +458,7 @@ static void vty_hist_add(struct vty *vty)
/* Insert history entry. */
if (vty->hist[vty->hindex])
talloc_free(vty->hist[vty->hindex]);
- vty->hist[vty->hindex] = talloc_strdup(tall_vty_ctx, vty->buf);
+ vty->hist[vty->hindex] = talloc_strdup(vty, vty->buf);
/* History index rotation. */
vty->hindex++;
@@ -965,7 +965,7 @@ vty_describe_fold(struct vty *vty, int cmd_width,
return;
}
- buf = _talloc_zero(tall_vty_ctx, strlen(desc->str) + 1, "describe_fold");
+ buf = _talloc_zero(vty, strlen(desc->str) + 1, "describe_fold");
if (!buf)
return;