diff options
author | Lennart Poettering <lennart@poettering.net> | 2008-04-11 16:20:33 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2008-04-11 16:20:33 +0000 |
commit | e1c1a782b65e5e207b72e88f3ae04720a743c7e8 (patch) | |
tree | 6966f5e482228677cb3af63216c3c72e16021797 | |
parent | bb9792a616c5e2cae9526974054325854a75b0f2 (diff) |
fix proplist serialization
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2233 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r-- | src/pulsecore/tagstruct.c | 13 | ||||
-rw-r--r-- | src/pulsecore/tagstruct.h | 3 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/pulsecore/tagstruct.c b/src/pulsecore/tagstruct.c index 92bace27..fb412a4a 100644 --- a/src/pulsecore/tagstruct.c +++ b/src/pulsecore/tagstruct.c @@ -570,10 +570,11 @@ int pa_tagstruct_get_proplist(pa_tagstruct *t, pa_proplist *p) { return -1; saved_rindex = t->rindex; + t->rindex++; for (;;) { const char *k; - void *d; + const void *d; uint32_t length; if (pa_tagstruct_gets(t, &k) < 0) @@ -588,17 +589,11 @@ int pa_tagstruct_get_proplist(pa_tagstruct *t, pa_proplist *p) { if (length > MAX_TAG_SIZE) goto fail; - d = pa_xmalloc(length); - - if (pa_tagstruct_get_arbitrary(t, d, length) < 0) + if (pa_tagstruct_get_arbitrary(t, &d, length) < 0) goto fail; - if (pa_proplist_set(p, k, d, length) < 0) { - pa_xfree(d); + if (pa_proplist_set(p, k, d, length) < 0) goto fail; - } - - pa_xfree(d); } return 0; diff --git a/src/pulsecore/tagstruct.h b/src/pulsecore/tagstruct.h index 8846b301..8699e6c8 100644 --- a/src/pulsecore/tagstruct.h +++ b/src/pulsecore/tagstruct.h @@ -33,6 +33,9 @@ #include <pulse/channelmap.h> #include <pulse/volume.h> #include <pulse/proplist.h> +#include <pulse/gccmacro.h> + +#include <pulsecore/macro.h> typedef struct pa_tagstruct pa_tagstruct; |