[Coverity 1398436] Use after free in svg.c
This could cause an immediate crash or incorrect values might be read subsequently resulting in incorrect computations.
In svg_LoadTemplate: A pointer to freed memory is dereferenced, used as a function argument, or otherwise used (CWE-416)
123 if( psz_template )
124 {
CID 1398415:String not null terminated (STRING_NULL) [ "select issue" ]
125 p_sys->psz_token = strstr( psz_template, SVG_TEMPLATE_BODY_TOKEN );
9. Condition !p_sys->psz_token, taking true branch.
126 if( !p_sys->psz_token )
127 {
128 msg_Err( p_filter, "'%s' not found in SVG template", SVG_TEMPLATE_BODY_TOKEN );
10. freed_arg: free frees psz_template.
129 free( psz_template );
11. Falling through to end of if statement.
130 }
131 else *((char*)p_sys->psz_token) = 0;
132 }
133
CID 1398436: (#1 of 1): Use after free (USE_AFTER_FREE)
12. use_after_free: Using freed pointer psz_template.
134 p_sys->psz_file_template = psz_template;