aboutsummaryrefslogtreecommitdiff
path: root/bin/ed
diff options
context:
space:
mode:
authorChristian Brueffer <brueffer@FreeBSD.org>2011-08-27 15:28:57 +0000
committerChristian Brueffer <brueffer@FreeBSD.org>2011-08-27 15:28:57 +0000
commitae568477e7ceec9658e1ec561b0e885a0dd5f287 (patch)
treecfb5f8cd39ff7488b27fbfb054f1bfa5b3b2c678 /bin/ed
parente5a0927394502ac7d7d0383c523490eb35f773dc (diff)
Notes
Diffstat (limited to 'bin/ed')
-rw-r--r--bin/ed/buf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/ed/buf.c b/bin/ed/buf.c
index db1f0e981bfb..b4b78a5565b5 100644
--- a/bin/ed/buf.c
+++ b/bin/ed/buf.c
@@ -94,6 +94,7 @@ put_sbuf_line(const char *cs)
;
if (s - cs >= LINECHARS) {
errmsg = "line too long";
+ free(lp);
return NULL;
}
len = s - cs;
@@ -102,6 +103,7 @@ put_sbuf_line(const char *cs)
if (fseeko(sfp, (off_t)0, SEEK_END) < 0) {
fprintf(stderr, "%s\n", strerror(errno));
errmsg = "cannot seek temp file";
+ free(lp);
return NULL;
}
sfseek = ftello(sfp);
@@ -112,6 +114,7 @@ put_sbuf_line(const char *cs)
sfseek = -1;
fprintf(stderr, "%s\n", strerror(errno));
errmsg = "cannot write temp file";
+ free(lp);
return NULL;
}
lp->len = len;