From 5691b812b4f8ec33d134b551551e09b8f3fbe545 Mon Sep 17 00:00:00 2001 From: Juuso Alasuutari Date: Fri, 12 Jun 2020 00:17:31 +0300 Subject: [PATCH] Don't free resized image if it's a reference Fixes: a95bc3f5b69cfec0c82ff4ba7ae182cedc77a9e9 Signed-off-by: Juuso Alasuutari --- src/classifier.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/classifier.c b/src/classifier.c index dfab4662..e23b1d7d 100644 --- a/src/classifier.c +++ b/src/classifier.c @@ -862,9 +862,13 @@ void predict_classifier(char *datacfg, char *cfgfile, char *weightfile, char *fi if(net.hierarchy) printf("%d, %s: %f, parent: %s \n",index, names[index], predictions[index], (net.hierarchy->parent[index] >= 0) ? names[net.hierarchy->parent[index]] : "Root"); else printf("%s: %f\n",names[index], predictions[index]); } + free_image(cropped); + if (resized.data != im.data) { + free_image(resized); + } free_image(im); - free_image(resized); + if (filename) break; } free(indexes);