avutil/eval: factor av_expr_free() calls out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
		
							parent
							
								
									b63c9a9990
								
							
						
					
					
						commit
						61123634dd
					
				@ -683,19 +683,19 @@ int av_expr_parse(AVExpr **expr, const char *s,
 | 
				
			|||||||
    if ((ret = parse_expr(&e, &p)) < 0)
 | 
					    if ((ret = parse_expr(&e, &p)) < 0)
 | 
				
			||||||
        goto end;
 | 
					        goto end;
 | 
				
			||||||
    if (*p.s) {
 | 
					    if (*p.s) {
 | 
				
			||||||
        av_expr_free(e);
 | 
					 | 
				
			||||||
        av_log(&p, AV_LOG_ERROR, "Invalid chars '%s' at the end of expression '%s'\n", p.s, s0);
 | 
					        av_log(&p, AV_LOG_ERROR, "Invalid chars '%s' at the end of expression '%s'\n", p.s, s0);
 | 
				
			||||||
        ret = AVERROR(EINVAL);
 | 
					        ret = AVERROR(EINVAL);
 | 
				
			||||||
        goto end;
 | 
					        goto end;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (!verify_expr(e)) {
 | 
					    if (!verify_expr(e)) {
 | 
				
			||||||
        av_expr_free(e);
 | 
					 | 
				
			||||||
        ret = AVERROR(EINVAL);
 | 
					        ret = AVERROR(EINVAL);
 | 
				
			||||||
        goto end;
 | 
					        goto end;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    e->var= av_mallocz(sizeof(double) *VARS);
 | 
					    e->var= av_mallocz(sizeof(double) *VARS);
 | 
				
			||||||
    *expr = e;
 | 
					    *expr = e;
 | 
				
			||||||
 | 
					    e = NULL;
 | 
				
			||||||
end:
 | 
					end:
 | 
				
			||||||
 | 
					    av_expr_free(e);
 | 
				
			||||||
    av_free(w);
 | 
					    av_free(w);
 | 
				
			||||||
    return ret;
 | 
					    return ret;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user