diff --git a/src/solaris/native/sun/awt/awt_UNIXToolkit.c b/src/solaris/native/sun/awt/awt_UNIXToolkit.c index c8b29f3bdcc94e3809f97acbb364ce155563b4da..4879f7456ac030c9cbed75fb41a45f4ec5dddb4b 100644 --- a/src/solaris/native/sun/awt/awt_UNIXToolkit.c +++ b/src/solaris/native/sun/awt/awt_UNIXToolkit.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -209,6 +209,7 @@ Java_sun_awt_UNIXToolkit_load_1stock_1icon(JNIEnv *env, jobject this, detail_str = (char *)SAFE_SIZE_ARRAY_ALLOC(malloc, sizeof(char), len + 1); if (detail_str == NULL) { + free(stock_id_str); JNU_ThrowOutOfMemoryError(env, "OutOfMemoryError"); return JNI_FALSE; }