protect ghash

This commit is contained in:
Jan-Piet Mens
2015-09-16 08:46:52 +02:00
parent b84b6d055e
commit 61b9feca9f
+4 -3
View File
@@ -500,6 +500,7 @@ static JsonNode *line_to_location(char *line)
if (json_copy_to_object(o, json, FALSE) == FALSE) {
json_delete(o);
json_delete(json);
return (NULL);
}
@@ -513,7 +514,10 @@ static JsonNode *line_to_location(char *line)
if ((ghash = geohash_encode(lat, lon, geohash_prec())) != NULL) {
json_append_member(o, "ghash", json_mkstring(ghash));
get_geo(o, ghash);
free(ghash);
}
json_append_member(o, "isorcv", json_mkstring(tstamp));
tst = 0L;
@@ -522,9 +526,6 @@ static JsonNode *line_to_location(char *line)
}
json_append_member(o, "isotst", json_mkstring(isotime(tst)));
get_geo(o, ghash);
free(ghash);
return (o);
}