aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editors/sed.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/editors/sed.c b/editors/sed.c
index 219a44008..ed584e5df 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -1054,7 +1054,7 @@ restart:
case 'x': /* Exchange hold and pattern space */
{
char *tmp = pattern_space;
- pattern_space = bbg.hold_space;
+ pattern_space = bbg.hold_space ? : xzalloc(1);
no_newline=0;
bbg.hold_space = tmp;
break;