Explorar o código

Fix a stupid potential segfault

Eric Andersen %!s(int64=22) %!d(string=hai) anos
pai
achega
ed4b5a14e4
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      utils/ldd.c

+ 2 - 1
utils/ldd.c

@@ -653,7 +653,8 @@ int main( int argc, char** argv)
 		for (cur = lib_list; cur; cur=cur->next) {
 			free(cur->name);
 			cur->name=NULL;
-			free(cur->path);
+			if (cur->path && cur->path != not_found)
+				free(cur->path);
 			cur->path=NULL;
 		}
 		lib_list=NULL;