mirror of https://gerrit.osmocom.org/gapk
procqueue: set talloc name and context for queue description
Previously a queue description string was allocated without setting proper parental talloc context and proper name.
This commit is contained in:
parent
7279d9f057
commit
fb2326fbcf
|
@ -219,6 +219,10 @@ osmo_gapk_pq_describe(struct osmo_gapk_pq *pq)
|
|||
char *result = NULL;
|
||||
int i = 0;
|
||||
|
||||
/* Nothing to describe */
|
||||
if (!pq->n_items)
|
||||
return NULL;
|
||||
|
||||
/* Iterate over all items in queue */
|
||||
llist_for_each_entry(item, &pq->items, list) {
|
||||
result = talloc_asprintf_append(result, "%s/%s%s",
|
||||
|
@ -226,5 +230,11 @@ osmo_gapk_pq_describe(struct osmo_gapk_pq *pq)
|
|||
++i < pq->n_items ? " -> " : "");
|
||||
}
|
||||
|
||||
/* Change talloc context name */
|
||||
talloc_set_name_const(result, ".description");
|
||||
|
||||
/* Change parent talloc context to pq */
|
||||
talloc_steal(pq, result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue