OSDN Git Service
(root)
/
android-x86
/
external-toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
12adb41
)
Usischev Yury pointed out a use after free error.
author
Rob Landley
<rob@landley.net>
Sat, 23 Jul 2016 23:12:48 +0000
(18:12 -0500)
committer
Rob Landley
<rob@landley.net>
Sat, 23 Jul 2016 23:12:48 +0000
(18:12 -0500)
toys/posix/sed.c
patch
|
blob
|
history
diff --git
a/toys/posix/sed.c
b/toys/posix/sed.c
index
45816c2
..
45331ba
100644
(file)
--- a/
toys/posix/sed.c
+++ b/
toys/posix/sed.c
@@
-635,8
+635,6
@@
writenow:
if (line && !(toys.optflags & FLAG_n)) emit(line, len, eol);
done:
- free(line);
-
if (dlist_terminate(append)) while (append) {
struct append *a = append->next;
@@
-655,6
+653,7
@@
done:
free(append);
append = a;
}
+ free(line);
}
// Genericish function, can probably get moved to lib.c