Browse Source

Fix memory leak

pull/2802/head
lixingcong 3 years ago
committed by Max Lv
parent
commit
e04b73d1b6
3 changed files with 11 additions and 0 deletions
  1. 4
      src/redir.c
  2. 4
      src/tunnel.c
  3. 3
      src/udprelay.c

4
src/redir.c

@ -1381,5 +1381,9 @@ main(int argc, char **argv)
stop_plugin();
}
for (i = 0; i < remote_num; i++)
ss_free(listen_ctx.remote_addr[i]);
ss_free(listen_ctx.remote_addr);
return ret_val;
}

4
src/tunnel.c

@ -1427,6 +1427,10 @@ main(int argc, char **argv)
stop_plugin();
}
for (i = 0; i < remote_num; i++)
ss_free(listen_ctx.remote_addr[i]);
ss_free(listen_ctx.remote_addr);
#ifdef __MINGW32__
if (plugin_watcher.valid) {
closesocket(plugin_watcher.fd);

3
src/udprelay.c

@ -1467,6 +1467,9 @@ free_udprelay()
ev_io_stop(loop, &server_ctx->io);
close(server_ctx->fd);
cache_delete(server_ctx->conn_cache, 0);
#ifdef MODULE_LOCAL
free((char*) server_ctx->remote_addr);
#endif
ss_free(server_ctx);
server_ctx_list[server_num] = NULL;
}

Loading…
Cancel
Save