summaryrefslogtreecommitdiff
path: root/src/analysis/binary.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-09-08 18:15:32 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-09-08 18:15:32 (GMT)
commit3e1347d378e7ff0e21fb53b61e0317b8dfe52fc9 (patch)
tree1932b705551e4790c2f5c7fb0f9b7d80785d2225 /src/analysis/binary.c
parent1430874c1ce9d5e38a23bf27049ebc5f6a6619bb (diff)
Used the SSL link with more care.
Diffstat (limited to 'src/analysis/binary.c')
-rw-r--r--src/analysis/binary.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/analysis/binary.c b/src/analysis/binary.c
index 5d72c41..070e175 100644
--- a/src/analysis/binary.c
+++ b/src/analysis/binary.c
@@ -1102,12 +1102,19 @@ bool _g_loaded_binary_add_to_collection(GLoadedBinary *binary, GDbItem *item, bo
tls_fd = g_hub_client_get_ssl_fd(client);
- result = g_db_collection_pack(collec, &out_pbuf, DBA_ADD_ITEM, item);
+ if (tls_fd == NULL)
+ result = false;
- if (result)
- result = ssl_send_packed_buffer(&out_pbuf, tls_fd);
+ else
+ {
+ result = g_db_collection_pack(collec, &out_pbuf, DBA_ADD_ITEM, item);
- g_hub_client_put_ssl_fd(client, tls_fd);
+ if (result)
+ result = ssl_send_packed_buffer(&out_pbuf, tls_fd);
+
+ g_hub_client_put_ssl_fd(client, tls_fd);
+
+ }
exit_packed_buffer(&out_pbuf);
@@ -1171,12 +1178,19 @@ bool _g_loaded_binary_remove_from_collection(GLoadedBinary *binary, DBFeatures f
tls_fd = g_hub_client_get_ssl_fd(client);
- result = g_db_collection_pack(collec, &out_pbuf, DBA_REM_ITEM, item);
+ if (tls_fd == NULL)
+ result = false;
+
+ else
+ {
+ result = g_db_collection_pack(collec, &out_pbuf, DBA_REM_ITEM, item);
- if (result)
- result = ssl_send_packed_buffer(&out_pbuf, tls_fd);
+ if (result)
+ result = ssl_send_packed_buffer(&out_pbuf, tls_fd);
+
+ g_hub_client_put_ssl_fd(client, tls_fd);
- g_hub_client_put_ssl_fd(client, tls_fd);
+ }
exit_packed_buffer(&out_pbuf);