From a300ce5b2e3125c5e6dc161c41e26bf0adaedded Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 12 Sep 2014 08:07:38 -0400 Subject: [PATCH] command: Fix possible null dereference in rarch_cmd_free Free called on null pointers is OK, but if it's ever null and it hits this conditional, it will be a null pointer dereference. --- command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command.c b/command.c index 37a0b7a690..ca3be010ff 100644 --- a/command.c +++ b/command.c @@ -161,7 +161,7 @@ error: void rarch_cmd_free(rarch_cmd_t *handle) { #if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY) - if (handle->net_fd >= 0) + if (handle && handle->net_fd >= 0) close(handle->net_fd); #endif