diff options
author | Jyri Sarha <jyri.sarha@nokia.com> | 2011-01-13 16:44:41 +0200 |
---|---|---|
committer | Colin Guthrie <cguthrie@mandriva.org> | 2011-01-15 13:22:13 +0000 |
commit | 34d022c16e654975c771f76511ef0d89bef6bec2 (patch) | |
tree | 1735a002b807256776d948e4305feae7119670d2 /src/pulsecore/flist.c | |
parent | a37e0963efbdd9ef22561f9c1ab386ee2c09280d (diff) |
core: Change sematics of pa_flist_new_with_name() (v1.1)
Name string is copied and added to flist structure. The original is
responsibility of the caller. The name is only used for debug printing.
Diffstat (limited to 'src/pulsecore/flist.c')
-rw-r--r-- | src/pulsecore/flist.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pulsecore/flist.c b/src/pulsecore/flist.c index 1867525b..23af5dd4 100644 --- a/src/pulsecore/flist.c +++ b/src/pulsecore/flist.c @@ -83,13 +83,14 @@ static void stack_push(pa_atomic_ptr_t *list, pa_flist_elem *new_elem) { pa_flist *pa_flist_new_with_name(unsigned size, const char *name) { pa_flist *l; unsigned i; + pa_assert(name); if (!size) size = FLIST_SIZE; l = pa_xmalloc0(sizeof(pa_flist) + sizeof(pa_flist_elem) * size); - l->name = name; + l->name = pa_xstrdup(name); l->size = size; pa_atomic_ptr_store(&l->stored, NULL); pa_atomic_ptr_store(&l->empty, NULL); @@ -105,6 +106,7 @@ pa_flist *pa_flist_new(unsigned size) { void pa_flist_free(pa_flist *l, pa_free_cb_t free_cb) { pa_assert(l); + pa_assert(l->name); if (free_cb) { pa_flist_elem *elem; |