aboutsummaryrefslogtreecommitdiff
path: root/src/namestore
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2016-08-29 08:20:01 +0000
committerMartin Schanzenbach <mschanzenbach@posteo.de>2016-08-29 08:20:01 +0000
commitcda23f9580da561752aee04753054aa6225af7cf (patch)
tree672c9aee2b8b69f949eddabf1ca53f5349e93150 /src/namestore
parent779db80dab9172bde626d5e0b0b93a435e7a7128 (diff)
downloadgnunet-cda23f9580da561752aee04753054aa6225af7cf.tar.gz
gnunet-cda23f9580da561752aee04753054aa6225af7cf.zip
- fix coverity
Diffstat (limited to 'src/namestore')
-rw-r--r--src/namestore/plugin_namestore_flat.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/namestore/plugin_namestore_flat.c b/src/namestore/plugin_namestore_flat.c
index 869aa3d9f..4f5034d26 100644
--- a/src/namestore/plugin_namestore_flat.c
+++ b/src/namestore/plugin_namestore_flat.c
@@ -192,7 +192,7 @@ database_setup (struct Plugin *plugin)
192 return GNUNET_SYSERR; 192 return GNUNET_SYSERR;
193 } 193 }
194 194
195 buffer = GNUNET_malloc (size) + 1; 195 buffer = GNUNET_malloc (size + 1);
196 if (GNUNET_SYSERR == 196 if (GNUNET_SYSERR ==
197 GNUNET_DISK_file_read (fh, 197 GNUNET_DISK_file_read (fh,
198 buffer, 198 buffer,
@@ -201,8 +201,11 @@ database_setup (struct Plugin *plugin)
201 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 201 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
202 _("Unable to read file: %s.\n"), 202 _("Unable to read file: %s.\n"),
203 afsdir); 203 afsdir);
204 GNUNET_free (buffer);
205 GNUNET_DISK_file_close (fh);
204 return GNUNET_SYSERR; 206 return GNUNET_SYSERR;
205 } 207 }
208 buffer[size] = '\0';
206 GNUNET_DISK_file_close (fh); 209 GNUNET_DISK_file_close (fh);
207 210
208 if (0 < size) 211 if (0 < size)
@@ -341,6 +344,7 @@ store_and_free_entries (void *cls,
341 line, 344 line,
342 strlen (line)); 345 strlen (line));
343 346
347 GNUNET_free (line);
344 GNUNET_free (entry->private_key); 348 GNUNET_free (entry->private_key);
345 GNUNET_free (entry->label); 349 GNUNET_free (entry->label);
346 GNUNET_free (entry->record_data); 350 GNUNET_free (entry->record_data);