< prev index next >
src/java.smartcardio/share/native/libj2pcsc/pcsc.c
Print this page
rev 50999 : 8207233: Minor improvements of jdk C-coding
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -190,11 +190,11 @@
if (handleRV(env, rv)) {
return NULL;
}
dprintf1("-size: %d\n", size);
- if (size) {
+ if (size != 0) {
mszReaders = malloc(size);
if (mszReaders == NULL) {
throwOutOfMemoryError(env, NULL);
return NULL;
}
@@ -203,10 +203,12 @@
if (handleRV(env, rv)) {
free(mszReaders);
return NULL;
}
dprintf1("-String: %s\n", mszReaders);
+ } else {
+ return NULL;
}
result = pcsc_multi2jstring(env, mszReaders);
free(mszReaders);
return result;
< prev index next >