Match up the malloc/free for this buffer rather than freeing it as
soon as possible in some helper function three levels down.
}
code = svgtiny_parse(diagram, buffer, bytecount, "", width, height);
}
code = svgtiny_parse(diagram, buffer, bytecount, "", width, height);
if (code != svgtiny_OK) {
switch (code) {
if (code != svgtiny_OK) {
switch (code) {
context->updated_func = updated_func;
context->user_data = user_data;
context->updated_func = updated_func;
context->user_data = user_data;
- /* YOLO, no error checking */
- context->svg_data = g_malloc(0);
+ context->svg_data = NULL;
context->svg_data_size = 0;
return context;
context->svg_data_size = 0;
return context;
g_propagate_error(error, sub_error);
result = FALSE;
}
g_propagate_error(error, sub_error);
result = FALSE;
}
+ g_free(context->svg_data);
g_free(context);
return result;
g_free(context);
return result;