Skip to content

Commit

Permalink
8263893: getPrinterNames() leaks nameArray if Java String allocation …
Browse files Browse the repository at this point in the history
…fails
  • Loading branch information
aivanov-jdk committed Mar 19, 2021
1 parent d41f751 commit e96fbd2
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -175,6 +175,10 @@ static jobjectArray getPrinterNames(JNIEnv *env, DWORD flags) {
}
} catch (std::bad_alloc&) {
delete [] pPrinterEnum;
if (nameArray != NULL) {
env->DeleteLocalRef(nameArray);
nameArray = NULL;
}
throw;
}

Expand Down

0 comments on commit e96fbd2

Please sign in to comment.