Browse Source

fix ANDROID-35: memory leak

Brenton Bostick 2 years ago
parent
commit
dd1b52c7d9
1 changed files with 2 additions and 0 deletions
  1. 2 0
      java/jni/com_zerotierone_sdk_Node.cpp

+ 2 - 0
java/jni/com_zerotierone_sdk_Node.cpp

@@ -992,6 +992,8 @@ JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_processVirtualNetworkFrame(
         frameLength,
         frameLength,
         &nextBackgroundTaskDeadline);
         &nextBackgroundTaskDeadline);
 
 
+    free(localData);
+
     jlong *outDeadline = (jlong*)env->GetPrimitiveArrayCritical(out_nextBackgroundTaskDeadline, NULL);
     jlong *outDeadline = (jlong*)env->GetPrimitiveArrayCritical(out_nextBackgroundTaskDeadline, NULL);
     outDeadline[0] = (jlong)nextBackgroundTaskDeadline;
     outDeadline[0] = (jlong)nextBackgroundTaskDeadline;
     env->ReleasePrimitiveArrayCritical(out_nextBackgroundTaskDeadline, outDeadline, 0);
     env->ReleasePrimitiveArrayCritical(out_nextBackgroundTaskDeadline, outDeadline, 0);