[uClibc-cvs] uClibc/utils ldd.c,1.9,1.10

Erik Andersen andersen at uclibc.org
Fri Feb 13 11:05:39 UTC 2004


Update of /var/cvs/uClibc/utils
In directory nail:/tmp/cvs-serv27401

Modified Files:
	ldd.c 
Log Message:
Done free path if it equals not_found
Remember to flose an fopened file


Index: ldd.c
===================================================================
RCS file: /var/cvs/uClibc/utils/ldd.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- ldd.c	13 Feb 2004 11:01:02 -0000	1.9
+++ ldd.c	13 Feb 2004 11:05:36 -0000	1.10
@@ -460,7 +460,8 @@
 				//printf("find_elf_interpreter is replacing '%s' (already in list)\n", cur->name);
 				newlib = cur;
 				free(newlib->name);
-				free(newlib->path);
+				if (newlib->path != not_found) {
+					free(newlib->path);
 				newlib->name = NULL;
 				newlib->path = NULL;
 				return NULL;
@@ -515,6 +516,7 @@
 	}
 	if (fstat(fileno(thefile), &statbuf) < 0) {
 		perror(filename);
+		flose(thefile);
 		return -1;
 	}
 
@@ -529,6 +531,8 @@
 			PROT_READ|PROT_WRITE, MAP_PRIVATE, fileno(thefile), 0);
 
 foo:
+	flose(thefile);
+
 	/* Check if this looks like a legit ELF file */
 	if (check_elf_header(ehdr)) {
 		fprintf(stderr, "%s: not an ELF file.\n", filename);




More information about the uClibc-cvs mailing list