Browse Source

Fix a null-pointer deref when writing geoip stats

Found by coverity; CID 1327892.
Nick Mathewson 8 years ago
parent
commit
4604b3ab19
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/or/geoip.c

+ 2 - 0
src/or/geoip.c

@@ -1279,6 +1279,8 @@ geoip_dirreq_stats_write(time_t now)
 
   /* Generate history string .*/
   str = geoip_format_dirreq_stats(now);
+  if (! str)
+    goto done;
 
   /* Write dirreq-stats string to disk. */
   if (!check_or_create_data_subdir("stats")) {