← Commit list

2272129a9

Denys Vlasenko
Denys Vlasenko
2010-12-28
FAILED Duration: 213s

Subject

plug a DIR* leak on error path

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

libbb/find_root_device.c+5 -4
@@ -29,14 +29,15 @@ static char *find_block_device_in_dir(struct arena *ap)
char *retpath = NULL;
int len, rem;
- dir = opendir(ap->devpath);
- if (!dir)
- return NULL;
-
len = strlen(ap->devpath);
rem = DEVNAME_MAX-2 - len;
if (rem <= 0)
return NULL;
+
+ dir = opendir(ap->devpath);
+ if (!dir)
+ return NULL;
+
ap->devpath[len++] = '/';
while ((entry = readdir(dir)) != NULL) {