projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c9d929d
)
(finclude): Set fp->buf earlier, so it's freed on error.
author
Richard Stallman
<rms@gnu.org>
Wed, 7 Oct 1992 07:57:31 +0000
(07:57 +0000)
committer
Richard Stallman
<rms@gnu.org>
Wed, 7 Oct 1992 07:57:31 +0000
(07:57 +0000)
From-SVN: r2348
gcc/cccp.c
patch
|
blob
|
history
diff --git
a/gcc/cccp.c
b/gcc/cccp.c
index 5e055bed6d07ec88fd3bfd4122d456698eae8597..adaec4698575b27ea8de85234e092bf14b1d8493 100644
(file)
--- a/
gcc/cccp.c
+++ b/
gcc/cccp.c
@@
-4087,6
+4087,7
@@
finclude (f, fname, op, system_header_p, dirptr)
st_size = 0;
basep = (U_CHAR *) xmalloc (bsize + 2);
+ fp->buf = basep; /* So it will get freed, on error. */
bufp = basep;
for (;;) {
@@
-4100,10
+4101,10
@@
finclude (f, fname, op, system_header_p, dirptr)
if (bsize == st_size) { /* Buffer is full! */
bsize *= 2;
basep = (U_CHAR *) xrealloc (basep, bsize + 2);
+ fp->buf = basep;
bufp = basep + st_size; /* May have moved */
}
}
- fp->buf = basep;
fp->bufp = fp->buf;
fp->length = st_size;
}