#include "autofill_config.h"
static rpc_port_proxy_AutofillSvcPort_h svc_rpc_h = NULL;
+static rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h fill_response_received_cb_h = NULL;
+static rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h auth_info_cb_h = NULL;
static int connect_service();
{
LOGI("[__RPC_PORT__] connected");
- rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h fill_response_received_cb_h = rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_create(__fill_response_recv_cb, false, NULL);
- rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h auth_info_cb_h = rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_create(__auth_info_recv_cb, false, NULL);
+ if (fill_response_received_cb_h) {
+ free(fill_response_received_cb_h);
+ }
+
+ if (auth_info_cb_h) {
+ free(auth_info_cb_h);
+ }
+
+ fill_response_received_cb_h = rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_create(__fill_response_recv_cb, false, NULL);
+ auth_info_cb_h = rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_create(__auth_info_recv_cb, false, NULL);
int r = rpc_port_proxy_AutofillSvcPort_invoke_Register(h, auth_info_cb_h, fill_response_received_cb_h);
if (r != 0)
LOGD("disconnected");
svc_rpc_h = NULL;
+
+ if (fill_response_received_cb_h) {
+ free(fill_response_received_cb_h);
+ fill_response_received_cb_h = NULL;
+ }
+
+ if (auth_info_cb_h) {
+ free(auth_info_cb_h);
+ auth_info_cb_h = NULL;
+ }
}
static void __on_rejected(rpc_port_proxy_AutofillSvcPort_h h, void *user_data)