History

lavfi/dnn_backend_openvino.c: fix mem leak for input_blob and output_blob upon error

Guo, Yejun committed 5 years ago

Commit bd3ca081 parent 3ce2ee71 file · +4 −0Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/dnn/dnn_backend_openvino.c+4−0
@@ -141,12 +141,14 @@ static DNNReturnType fill_model_input_ov(OVModel *ov_model, RequestItem *request · 140 unmodified lines
141 status |= ie_blob_get_dims(input_blob, &dims);141 status |= ie_blob_get_dims(input_blob, &dims);
142 status |= ie_blob_get_precision(input_blob, &precision);142 status |= ie_blob_get_precision(input_blob, &precision);
143 if (status != OK) {143 if (status != OK) {
144 ie_blob_free(&input_blob);
144 av_log(ctx, AV_LOG_ERROR, "Failed to get input blob dims/precision\n");145 av_log(ctx, AV_LOG_ERROR, "Failed to get input blob dims/precision\n");
145 return DNN_ERROR;146 return DNN_ERROR;
146 }147 }
147 148
148 status = ie_blob_get_buffer(input_blob, &blob_buffer);149 status = ie_blob_get_buffer(input_blob, &blob_buffer);
149 if (status != OK) {150 if (status != OK) {
151 ie_blob_free(&input_blob);
150 av_log(ctx, AV_LOG_ERROR, "Failed to get input blob buffer\n");152 av_log(ctx, AV_LOG_ERROR, "Failed to get input blob buffer\n");
151 return DNN_ERROR;153 return DNN_ERROR;
152 }154 }
@@ -211,6 +213,7 @@ static void infer_completion_callback(void *args) · 58 unmodified lines
211 213
212 status = ie_blob_get_buffer(output_blob, &blob_buffer);214 status = ie_blob_get_buffer(output_blob, &blob_buffer);
213 if (status != OK) {215 if (status != OK) {
216 ie_blob_free(&output_blob);
214 av_log(ctx, AV_LOG_ERROR, "Failed to access output memory\n");217 av_log(ctx, AV_LOG_ERROR, "Failed to access output memory\n");
215 return;218 return;
216 }219 }
@@ -218,6 +221,7 @@ static void infer_completion_callback(void *args) · 1 unmodified line
218 status |= ie_blob_get_dims(output_blob, &dims);221 status |= ie_blob_get_dims(output_blob, &dims);
219 status |= ie_blob_get_precision(output_blob, &precision);222 status |= ie_blob_get_precision(output_blob, &precision);
220 if (status != OK) {223 if (status != OK) {
224 ie_blob_free(&output_blob);
221 av_log(ctx, AV_LOG_ERROR, "Failed to get dims or precision of output\n");225 av_log(ctx, AV_LOG_ERROR, "Failed to get dims or precision of output\n");
222 return;226 return;
223 }227 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t