diff options
Diffstat (limited to 'libjava/gnu')
| -rw-r--r-- | libjava/gnu/classpath/natSystemProperties.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libjava/gnu/classpath/natSystemProperties.cc b/libjava/gnu/classpath/natSystemProperties.cc index 089a14e5b4e..e259304b165 100644 --- a/libjava/gnu/classpath/natSystemProperties.cc +++ b/libjava/gnu/classpath/natSystemProperties.cc @@ -270,7 +270,10 @@ gnu::classpath::SystemProperties::insertSystemProperties (::java::util::Properti if (errno != ERANGE) break; buflen = 2 * buflen; + char *orig_buf = buffer; buffer = (char *) realloc (buffer, buflen); + if (buffer == NULL) + free (orig_buf); } if (buffer != NULL) free (buffer); |

