提交 71354c78 编写于 作者: K ksrini

7023416: (pack200) fix parfait issues

Reviewed-by: jrose
上级 e0bbf43e
......@@ -489,7 +489,6 @@ enum { CHUNK = (1 << 14), SMALL = (1 << 9) };
// Call malloc. Try to combine small blocks and free much later.
void* unpacker::alloc_heap(size_t size, bool smallOK, bool temp) {
CHECK_0;
if (!smallOK || size > SMALL) {
void* res = must_malloc((int)size);
(temp ? &tmallocs : &mallocs)->add(res);
......@@ -2560,6 +2559,10 @@ void unpacker::putlayout(band** body) {
int i;
int prevBII = -1;
int prevBCI = -1;
if (body == NULL) {
abort("putlayout: unexpected NULL for body");
return;
}
for (i = 0; body[i] != null; i++) {
band& b = *body[i];
byte le_kind = b.le_kind;
......@@ -4767,7 +4770,9 @@ void unpacker::redirect_stdio() {
}
char *tname = tempnam(tmpdir,"#upkg");
if (tname == NULL) return;
sprintf(log_file_name, "%s", tname);
::free(tname);
if ((errstrm = fopen(log_file_name, "a+")) != NULL) {
log_file = errstrm_name = saveStr(log_file_name);
return ;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册