aboutsummaryrefslogtreecommitdiffstats
path: root/vpp-japi
diff options
context:
space:
mode:
Diffstat (limited to 'vpp-japi')
-rw-r--r--vpp-japi/japi/vppjni.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/vpp-japi/japi/vppjni.c b/vpp-japi/japi/vppjni.c
index 45011467ebd..3c80ff9240c 100644
--- a/vpp-japi/japi/vppjni.c
+++ b/vpp-japi/japi/vppjni.c
@@ -894,11 +894,14 @@ static jintArray create_array_of_bd_ids(JNIEnv * env, jint bd_id)
}
jintArray bdidArray = (*env)->NewIntArray(env, vec_len(buf));
+ if (!bdidArray) {
+ goto out;
+ }
(*env)->SetIntArrayRegion(env, bdidArray, 0, vec_len(buf), (int*)buf);
+out:
vec_free(buf);
-
return bdidArray;
}