Created
September 14, 2016 20:20
-
-
Save gogglesguy/10c9745c98adff0bbd0ba93f777bf209 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/mapfile.c b/mapfile.c | |
index 731498a..50e8c46 100644 | |
--- a/mapfile.c | |
+++ b/mapfile.c | |
@@ -6973,11 +6973,14 @@ int msUpdateMapFromURL(mapObj *map, char *variable, char *string) | |
static void hashTableSubstituteString(hashTableObj *hash, const char *from, const char *to) { | |
const char *key, *val; | |
+ char *new_val; | |
key = msFirstKeyFromHashTable(hash); | |
while(key != NULL) { | |
val = msLookupHashTable(hash, key); | |
if(strcasestr(val, from)) { | |
- msInsertHashTable(hash, key, msCaseReplaceSubstring(msStrdup(val), from, to)); | |
+ new_val = msCaseReplaceSubstring(msStrdup(val), from, to); | |
+ msInsertHashTable(hash, key, new_val); | |
+ free(new_val); | |
} | |
key = msNextKeyFromHashTable(hash, key); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment