summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2013-05-28 14:25:02 +0100
committerStefan Schmidt <s.schmidt@samsung.com>2013-05-28 14:25:02 +0100
commit27e3c3f203f366f7e655e54d69201586fd5a3a4e (patch)
tree6aa355eb76805cd9d62f501649854b78a75a865e
parentf229398aebc92b74ab52d50e7251836ec2de8093 (diff)
elocation: Free possible old entries in the address struct.
This should normally not happen. The data is coming as dict over dbus and this should guarantee no double key entries in the dict. But better be safe than sorry.
-rw-r--r--src/lib/elocation.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/elocation.c b/src/lib/elocation.c
index 6c1781e..7c18e96 100644
--- a/src/lib/elocation.c
+++ b/src/lib/elocation.c
@@ -212,26 +212,32 @@ unmarshall_address(const EDBus_Message *reply, Elocation_Address *addr)
212 212
213 if (!strcmp(key, "country")) 213 if (!strcmp(key, "country"))
214 { 214 {
215 free(addr->country);
215 addr->country = strdup(value); 216 addr->country = strdup(value);
216 } 217 }
217 else if (!strcmp(key, "countrycode")) 218 else if (!strcmp(key, "countrycode"))
218 { 219 {
220 free(addr->countrycode);
219 addr->countrycode = strdup(value); 221 addr->countrycode = strdup(value);
220 } 222 }
221 else if (!strcmp(key, "locality")) 223 else if (!strcmp(key, "locality"))
222 { 224 {
225 free(addr->locality);
223 addr->locality = strdup(value); 226 addr->locality = strdup(value);
224 } 227 }
225 else if (!strcmp(key, "postalcode")) 228 else if (!strcmp(key, "postalcode"))
226 { 229 {
230 free(addr->postalcode);
227 addr->postalcode = strdup(value); 231 addr->postalcode = strdup(value);
228 } 232 }
229 else if (!strcmp(key, "region")) 233 else if (!strcmp(key, "region"))
230 { 234 {
235 free(addr->region);
231 addr->region = strdup(value); 236 addr->region = strdup(value);
232 } 237 }
233 else if (!strcmp(key, "timezone")) 238 else if (!strcmp(key, "timezone"))
234 { 239 {
240 free(addr->timezone);
235 addr->timezone = strdup(value); 241 addr->timezone = strdup(value);
236 } 242 }
237 } 243 }