Module Name: src Committed By: martin Date: Thu Oct 30 07:53:42 UTC 2014
Modified Files: src/libexec/ld.elf_so: map_object.c Log Message: Avoid use after free, reported by the coverity scanner. To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 src/libexec/ld.elf_so/map_object.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/libexec/ld.elf_so/map_object.c diff -u src/libexec/ld.elf_so/map_object.c:1.52 src/libexec/ld.elf_so/map_object.c:1.53 --- src/libexec/ld.elf_so/map_object.c:1.52 Sat Aug 3 13:17:05 2013 +++ src/libexec/ld.elf_so/map_object.c Thu Oct 30 07:53:41 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: map_object.c,v 1.52 2013/08/03 13:17:05 skrll Exp $ */ +/* $NetBSD: map_object.c,v 1.53 2014/10/30 07:53:41 martin Exp $ */ /* * Copyright 1996 John D. Polstra. @@ -34,7 +34,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: map_object.c,v 1.52 2013/08/03 13:17:05 skrll Exp $"); +__RCSID("$NetBSD: map_object.c,v 1.53 2014/10/30 07:53:41 martin Exp $"); #endif /* not lint */ #include <errno.h> @@ -442,10 +442,10 @@ _rtld_obj_free(Obj_Entry *obj) } if (!obj->phdr_loaded) xfree((void *)(uintptr_t)obj->phdr); - xfree(obj); #ifdef COMBRELOC _rtld_combreloc_reset(obj); #endif + xfree(obj); } Obj_Entry *