diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-07-06 11:14:11 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-07-06 11:14:11 +0000 |
commit | f5beb3eaf163fc0bf2a4f86bd413d3ee6939cfea (patch) | |
tree | b59a38ad9e2296b3d2c8cc3302f21cf6d3ecc458 /src/peerinfo | |
parent | 6db64c5eae089e1d81cafbb051f65412790d16bc (diff) |
-fix misc issues
Diffstat (limited to 'src/peerinfo')
-rw-r--r-- | src/peerinfo/gnunet-service-peerinfo.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c index 66082e8f78..8be6cf5abf 100644 --- a/src/peerinfo/gnunet-service-peerinfo.c +++ b/src/peerinfo/gnunet-service-peerinfo.c @@ -338,12 +338,12 @@ read_host_file (const char *fn, struct ReadHostFileContext *r) { char buffer[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1] GNUNET_ALIGN; - unsigned int size_total; + ssize_t size_total; struct GNUNET_TIME_Absolute now; unsigned int left; const struct GNUNET_HELLO_Message *hello; struct GNUNET_HELLO_Message *hello_clean; - unsigned read_pos; + size_t read_pos; int size_hello; r->friend_only_hello = NULL; @@ -1005,6 +1005,7 @@ discard_hosts_helper (void *cls, GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK, "unlink", fn); + GNUNET_free (writebuffer); return GNUNET_OK; } new_hello = GNUNET_HELLO_iterate_addresses (hello, @@ -1028,11 +1029,13 @@ discard_hosts_helper (void *cls, if (0 < write_pos) { - GNUNET_DISK_fn_write (fn, writebuffer,write_pos, - GNUNET_DISK_PERM_USER_READ | - GNUNET_DISK_PERM_USER_WRITE | - GNUNET_DISK_PERM_GROUP_READ | - GNUNET_DISK_PERM_OTHER_READ); + GNUNET_DISK_fn_write (fn, + writebuffer, + write_pos, + GNUNET_DISK_PERM_USER_READ | + GNUNET_DISK_PERM_USER_WRITE | + GNUNET_DISK_PERM_GROUP_READ | + GNUNET_DISK_PERM_OTHER_READ); } else if (0 != UNLINK (fn)) GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING | |