src/share/native/java/util/zip/Inflater.c

Print this page

        

*** 133,150 **** --- 133,152 ---- jint in_len = MIN2(this_len, len + 20); jint consumed; in_buf = (jbyte *) malloc(in_len); if (in_buf == 0) { + if (in_len != 0) JNU_ThrowOutOfMemoryError(env, 0); return 0; } (*env)->GetByteArrayRegion(env, this_buf, this_off, in_len, in_buf); out_buf = (jbyte *) malloc(len); if (out_buf == 0) { free(in_buf); + if (len != 0) JNU_ThrowOutOfMemoryError(env, 0); return 0; } strm->next_in = (Bytef *) in_buf;