[pulseaudio-discuss] [PATCH 1/5] core: Change sematics of pa_flist_new_with_name()

Colin Guthrie gmane at colin.guthr.ie
Wed Dec 22 01:54:55 PST 2010


'Twas brillig, and oku at iki.fi at 20/12/10 16:47 did gyre and gimble:
> @@ -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;
> @@ -112,6 +114,7 @@ void pa_flist_free(pa_flist *l, pa_free_cb_t free_cb) {
>              free_cb(pa_atomic_ptr_load(&elem->ptr));
>      }
>  
> +    pa_xfree(l->name);
>      pa_xfree(l);
>  }

The assert on l->name on free is probably overkill as pa_xfree will
silently ignore nulls anyway, so it would do no harm. That and it's
pretty much impossible for l->name to be null anyway...

OK to drop that assert?

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]




More information about the pulseaudio-discuss mailing list