aboutsummaryrefslogtreecommitdiffstats
path: root/src/fuzzy_storage.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-10-26 09:19:05 +0200
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-10-26 09:19:16 +0200
commit3d5132aa9b9be9b3542362015c3ed9e7160d894f (patch)
tree4cd291ffc76749249e5c353556a78afb94739934 /src/fuzzy_storage.c
parentfc811374f8926d2679a4e247b1586f781d0fcefc (diff)
downloadrspamd-3d5132aa9b9be9b3542362015c3ed9e7160d894f.tar.gz
rspamd-3d5132aa9b9be9b3542362015c3ed9e7160d894f.zip
[Minor] Fix warnings
Diffstat (limited to 'src/fuzzy_storage.c')
-rw-r--r--src/fuzzy_storage.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c
index 47173ae07..770337ca5 100644
--- a/src/fuzzy_storage.c
+++ b/src/fuzzy_storage.c
@@ -1749,10 +1749,13 @@ rspamd_fuzzy_storage_stat (struct rspamd_main *rspamd_main,
msg.msg_control = fdspace;
msg.msg_controllen = sizeof (fdspace);
cmsg = CMSG_FIRSTHDR (&msg);
- cmsg->cmsg_level = SOL_SOCKET;
- cmsg->cmsg_type = SCM_RIGHTS;
- cmsg->cmsg_len = CMSG_LEN (sizeof (int));
- memcpy (CMSG_DATA (cmsg), &outfd, sizeof (int));
+
+ if (cmsg) {
+ cmsg->cmsg_level = SOL_SOCKET;
+ cmsg->cmsg_type = SCM_RIGHTS;
+ cmsg->cmsg_len = CMSG_LEN (sizeof (int));
+ memcpy (CMSG_DATA (cmsg), &outfd, sizeof (int));
+ }
}
iov.iov_base = &rep;