Free the temporary vector 80/180/2
authorRobert Varga <nite@hq.sk>
Mon, 1 Feb 2016 17:33:38 +0000 (18:33 +0100)
committerRobert Varga <nite@hq.sk>
Mon, 1 Feb 2016 17:42:53 +0000 (18:42 +0100)
vec_add1() seems to be allocating memory which we do not free. Correct
that.

Change-Id: I25dca1871121cdd11a218ff2289a3c51b42e843b
Signed-off-by: Robert Varga <nite@hq.sk>
vpp-japi/japi/vppjni.c

index f7047bb..83090cf 100644 (file)
@@ -901,6 +901,8 @@ static jintArray create_array_of_bd_ids(JNIEnv * env, jint bd_id)
 
     (*env)->SetIntArrayRegion(env, bdidArray, 0, vec_len(buf), (int*)buf);
 
+    vec_free(buf);
+
     return bdidArray;
 }