[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r37482 - gnunet/src/peerstore
From: |
gnunet |
Subject: |
[GNUnet-SVN] r37482 - gnunet/src/peerstore |
Date: |
Thu, 7 Jul 2016 14:35:25 +0200 |
Author: schanzen
Date: 2016-07-07 14:35:25 +0200 (Thu, 07 Jul 2016)
New Revision: 37482
Modified:
gnunet/src/peerstore/plugin_peerstore_flat.c
Log:
-coverity
Modified: gnunet/src/peerstore/plugin_peerstore_flat.c
===================================================================
--- gnunet/src/peerstore/plugin_peerstore_flat.c 2016-07-07 12:33:13 UTC
(rev 37481)
+++ gnunet/src/peerstore/plugin_peerstore_flat.c 2016-07-07 12:35:25 UTC
(rev 37482)
@@ -394,7 +394,7 @@
return GNUNET_SYSERR;
}
- buffer = GNUNET_malloc (size);
+ buffer = GNUNET_malloc (size) + 1;
if (GNUNET_SYSERR == GNUNET_DISK_file_read (fh,
buffer,
@@ -403,9 +403,12 @@
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Unable to read file: %s.\n"),
afsdir);
+ GNUNET_DISK_file_close (fh);
+ GNUNET_free (buffer);
return GNUNET_SYSERR;
}
-
+
+ buffer[size] = '\0';
GNUNET_DISK_file_close (fh);
if (0 < size) {
line = strtok (buffer, "\n");
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r37482 - gnunet/src/peerstore,
gnunet <=