Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/Remmina/Remmina.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Weberhofer <jweberhofer@weberhofer.at>2016-03-03 17:13:33 +0300
committerJohannes Weberhofer <jweberhofer@weberhofer.at>2016-03-03 17:13:33 +0300
commit77fc69c557d9fbd4838b2957c2650fd0f63b3196 (patch)
tree71c426f880c850aa031f40ce26c2c2d8ffbf69a5 /remmina
parent0e935eb89199053c210e61cc9e5603a90bf6bb8c (diff)
pos_cache not nulled upon realloc failure
Diffstat (limited to 'remmina')
-rw-r--r--remmina/src/remmina_survey.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/remmina/src/remmina_survey.c b/remmina/src/remmina_survey.c
index 49f77907c..8c3961ff4 100644
--- a/remmina/src/remmina_survey.c
+++ b/remmina/src/remmina_survey.c
@@ -91,9 +91,11 @@ static char *repl_str(const char *str, const char *old, const char *new)
/* Increase the cache size when necessary. */
if (cache_sz < count) {
cache_sz += cache_sz_inc;
- pos_cache = realloc(pos_cache, sizeof(*pos_cache) * cache_sz);
- if (pos_cache == NULL) {
+ pos_cache_new = realloc(pos_cache, sizeof(*pos_cache) * cache_sz);
+ if (pos_cache_new == NULL) {
goto end_repl_str;
+ } else {
+ pos_cache = pos_cache_new;
}
cache_sz_inc *= cache_sz_inc_factor;
if (cache_sz_inc > cache_sz_inc_max) {