Fix coverity CID#66. Resource leak in error path.
authorJeremy Allison <jra@samba.org>
Fri, 30 Jan 2009 01:16:34 +0000 (17:16 -0800)
committerJeremy Allison <jra@samba.org>
Fri, 30 Jan 2009 01:16:34 +0000 (17:16 -0800)
Jeremy.

lib/util/xfile.c

index cf19570..16499e1 100644 (file)
@@ -112,6 +112,7 @@ XFILE *x_fopen(const char *fname, int flags, mode_t mode)
        if ((flags & O_ACCMODE) == O_RDWR) {
                /* we don't support RDWR in XFILE - use file 
                   descriptors instead */
+               SAFE_FREE(ret);
                errno = EINVAL;
                return NULL;
        }