diff options
author | 2004-11-20 12:05:59 +0000 | |
---|---|---|
committer | 2004-11-20 12:05:59 +0000 | |
commit | 78cedff0a0ccb2209e3b8598953d0490a9abdb3b (patch) | |
tree | 0f94d91aca4d1f951c327c73d588241abde790a0 /src | |
parent | close out a leak. (diff) | |
download | portage-cvs-78cedff0a0ccb2209e3b8598953d0490a9abdb3b.tar.gz portage-cvs-78cedff0a0ccb2209e3b8598953d0490a9abdb3b.tar.bz2 portage-cvs-78cedff0a0ccb2209e3b8598953d0490a9abdb3b.zip |
dumb ass realloc bug.
I hate realloc.
Diffstat (limited to 'src')
-rw-r--r-- | src/filter-env/posix.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/filter-env/posix.c b/src/filter-env/posix.c index 6d3ae5b..376a7ca 100644 --- a/src/filter-env/posix.c +++ b/src/filter-env/posix.c @@ -135,11 +135,11 @@ main(int argc, const char **argv) exit(MEM_FAIL); } while((c=read(fd,file_buff + file_size, 4096)) == 4096) { + file_size += 4096; if((file_buff = (char *)realloc(file_buff, file_size + 4096)) == NULL) { fprintf(stderr, "failed allocing needed memory for file.\n"); exit(MEM_FAIL); } - file_size += 4096; } file_size += c; if(c == 4095) { |