diff options
author | Stefan Kost <ensonic@users.sf.net> | 2009-05-22 23:14:41 +0300 |
---|---|---|
committer | Stefan Kost <ensonic@users.sf.net> | 2009-05-22 23:16:00 +0300 |
commit | 158895f56b200db93cc46bc56793de09ec1b1cb0 (patch) | |
tree | fc58d637402724c577afedd9bce6727899915042 | |
parent | 4faa75ab35600ab365d092fde9821457a89871e4 (diff) |
registry: don't free node-date and deref again. Fixes #580579
When writing a cache chunk fails, we were freeing the node and jump to a final
cleanup which dereferenced a null pointer. Leve freeing the node to the cleanup
code in fail_free_list. (sorry for committing wrong fix before).
-rw-r--r-- | gst/gstregistrybinary.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/gst/gstregistrybinary.c b/gst/gstregistrybinary.c index bafa662399..7e33e49678 100644 --- a/gst/gstregistrybinary.c +++ b/gst/gstregistrybinary.c @@ -766,10 +766,6 @@ gst_registry_binary_write_cache (GstRegistry * registry, const char *location) if (!gst_registry_binary_write_chunk (registry, cache, cur->data, cur->size, &file_position, cur->align)) { - if (!(cur->flags & GST_BINARY_REGISTRY_FLAG_CONST)) - g_free (cur->data); - g_free (cur); - walk->data = NULL; goto fail_free_list; } if (!(cur->flags & GST_BINARY_REGISTRY_FLAG_CONST)) @@ -790,11 +786,9 @@ fail_free_list: for (walk = to_write; walk; walk = g_list_next (walk)) { GstBinaryChunk *cur = walk->data; - if (cur) { - if (!(cur->flags & GST_BINARY_REGISTRY_FLAG_CONST)) - g_free (cur->data); - g_free (cur); - } + if (!(cur->flags & GST_BINARY_REGISTRY_FLAG_CONST)) + g_free (cur->data); + g_free (cur); } g_list_free (to_write); |