From 1dadf98653d1b107ae128881c11838ce81720854 Mon Sep 17 00:00:00 2001 From: meep-eep Date: Thu, 10 Jul 2003 00:27:57 +0000 Subject: [PATCH] Fixed memory leak in error handling. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1046 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/uio/ioaux.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sc2/src/sc2code/libs/uio/ioaux.c b/sc2/src/sc2code/libs/uio/ioaux.c index 762aa0881..cc7f6d0a5 100644 --- a/sc2/src/sc2code/libs/uio/ioaux.c +++ b/sc2/src/sc2code/libs/uio/ioaux.c @@ -570,7 +570,7 @@ uio_getPathPhysicalDirs(uio_DirHandle *dirHandle, const char *path, // ENOENT if some component didn't exist // ENOTDIR is some component exists, but is not a dir // something else (like EPATHTOOLONG) for internal errors -// 'resolvedPath' will be set to the absolute path as returned by +// On success, 'resolvedPath' will be set to the absolute path as returned by // uio_resolvePath. int uio_verifyPath(uio_DirHandle *dirHandle, const char *path, @@ -626,12 +626,14 @@ uio_verifyPath(uio_DirHandle *dirHandle, const char *path, fprintf(stderr, "Warning: Unknown error from " "uio_walkPhysicalPath: %s\n", strerror(retVal)); #endif + uio_free(*resolvedPath); errno = retVal; return -1; } } // No match, exit with ENOENT. + uio_free(*resolvedPath); errno = ENOENT; return -1; }