From 5cff62d6561dc63ef30b57d7ee415e6e1acdfb70 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 4 Jul 2002 17:18:14 +0000 Subject: [PATCH] * fhandler_socket.cc (fhandler_socket::set_sun_path): Don't free memory here. Allow NULL parameter. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/fhandler_socket.cc | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 6c0e04107..15f24ae98 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2002-07-04 Corinna Vinschen + + * fhandler_socket.cc (fhandler_socket::set_sun_path): Don't free + memory here. Allow NULL parameter. + 2002-07-04 Corinna Vinschen * fhandler_socket.cc (fhandler_socket::dup): Add missing copy operation diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index 01e9daead..7970e4b63 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -1141,7 +1141,5 @@ fhandler_socket::set_close_on_exec (int val) void fhandler_socket::set_sun_path (const char *path) { - if (sun_path) - cfree (sun_path); - sun_path = cstrdup (path); + sun_path = path ? cstrdup (path) : NULL; }