← Commit list

385cc5911

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

Subject

hush: plug a memory leak

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 →

shell/hush.c+1 -0
@@ -4136,6 +4136,7 @@ static NOINLINE int run_pipe(struct pipe *pi)
/* if someone gives us an empty string: `cmd with empty output` */
if (!argv_expanded[0]) {
+ free(argv_expanded);
debug_leave();
return G.last_exitcode;
}
shell/hush_test/hush-z_slow/leak_empty_tick.right+3 -0
@@ -0,0 +1,3 @@
+Warm up
+Measuring memory leak...
+Ok
shell/hush_test/hush-z_slow/leak_empty_tick.tests+28 -0
@@ -0,0 +1,28 @@
+echo "Warm up"
+i=1
+while test $i != 9; do
+ `true`
+ : $((i++))
+done
+
+memleak
+
+echo "Measuring memory leak..."
+i=1
+while test $i != 199; do
+ `true`
+ : $((i++))
+done
+i=1
+while test $i != 199; do
+ `true`
+ : $((i++))
+done
+
+memleak
+kb=$?
+if test $kb -le 4; then
+ echo Ok #$kb
+else
+ echo "Bad: $kb kb (or more) leaked"
+fi