svn commit: r208763 - head/libexec/rtld-elf

Alexander Kabaev kan at FreeBSD.org
Thu Jun 3 00:25:44 UTC 2010


Author: kan
Date: Thu Jun  3 00:25:43 2010
New Revision: 208763
URL: http://svn.freebsd.org/changeset/base/208763

Log:
  Plug possible memory leak.
  
  Found by:  Coverity
  MFC after: 2 weeks

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==============================================================================
--- head/libexec/rtld-elf/rtld.c	Thu Jun  3 00:00:45 2010	(r208762)
+++ head/libexec/rtld-elf/rtld.c	Thu Jun  3 00:25:43 2010	(r208763)
@@ -1530,8 +1530,10 @@ load_object(const char *name, const Obj_
 	close(fd);
 	return obj;
     }
-    if (flags & RTLD_LO_NOLOAD)
+    if (flags & RTLD_LO_NOLOAD) {
+	free(path);
 	return (NULL);
+    }
 
     /* First use of this object, so we must map it in */
     obj = do_load_object(fd, name, path, &sb, flags);


More information about the svn-src-all mailing list