diff options
Diffstat (limited to 'winsup/cygwin/path.h')
-rw-r--r-- | winsup/cygwin/path.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h index 6b6dc5d3b..3a9c08ca4 100644 --- a/winsup/cygwin/path.h +++ b/winsup/cygwin/path.h @@ -282,8 +282,12 @@ class path_conv PWCHAR get_wide_win32_path (PWCHAR wc); operator DWORD &() {return fileattr;} operator int () {return fileattr; } +# define cfree_maybe(x) if (x) cfree ((void *) (x)) path_conv &operator =(const path_conv& pc) { + cfree_maybe (path); + cfree_maybe (normalized_path); + cfree_maybe (wide_path); memcpy (this, &pc, sizeof pc); path = cstrdup (pc.path); conv_handle.dup (pc.conv_handle); @@ -297,11 +301,6 @@ class path_conv } return *this; } - void free_strings () - { - cfree (modifiable_path ()); - cfree ((char *) normalized_path); - } DWORD get_devn () {return (DWORD) dev;} short get_unitn () const {return dev.get_minor ();} DWORD file_attributes () const {return fileattr;} |