Free uid cache on destroy

This commit is contained in:
M66B 2019-07-17 09:56:27 +02:00
parent 7ca77aa956
commit 6c5e89450a
1 changed files with 8 additions and 0 deletions

View File

@ -36,6 +36,9 @@ extern FILE *pcap_file;
extern size_t pcap_record_size;
extern long pcap_file_size;
extern int uid_cache_size;
extern struct uid_cache_entry *uid_cache;
// JNI
jclass clsPacket;
@ -325,6 +328,11 @@ Java_eu_faircode_netguard_ServiceSinkhole_jni_1done(
if (close(ctx->pipefds[i]))
log_android(ANDROID_LOG_ERROR, "Close pipe error %d: %s", errno, strerror(errno));
if (uid_cache != NULL)
free(uid_cache);
uid_cache_size = 0;
uid_cache = NULL;
free(ctx);
}