summaryrefslogtreecommitdiff
path: root/src/analysis/binary.c
diff options
context:
space:
mode:
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);