diff --git a/attrib/gattrib.c b/attrib/gattrib.c
index cfa3b78..7fe7647 100644
--- a/attrib/gattrib.c
+++ b/attrib/gattrib.c
bt_att_response_func_t response_cb = NULL;
bt_att_destroy_func_t destroy_cb = NULL;
+ if (!attrib)
+ return 0;
+
if (!pdu || !len)
return 0;
gboolean g_attrib_cancel(GAttrib *attrib, guint id)
{
+ if (!attrib)
+ return FALSE;
+
return bt_att_cancel(attrib->att, id);
}
gboolean g_attrib_cancel_all(GAttrib *attrib)
{
+ if (!attrib)
+ return FALSE;
+
return bt_att_cancel_all(attrib->att);
}
{
struct attrib_callbacks *cb = NULL;
+ if (!attrib)
+ return 0;
+
if (func || notify) {
cb = new0(struct attrib_callbacks, 1);
if (!cb)
uint8_t *g_attrib_get_buffer(GAttrib *attrib, size_t *len)
{
- if (!len)
+ if (!attrib || !len)
return NULL;
*len = attrib->buflen;
gboolean g_attrib_set_mtu(GAttrib *attrib, int mtu)
{
+ if (!attrib)
+ return FALSE;
+
/*
* Clients of this expect a buffer to use.
*
gboolean g_attrib_unregister(GAttrib *attrib, guint id)
{
+ if (!attrib)
+ return FALSE;
+
return bt_att_unregister(attrib->att, id);
}
gboolean g_attrib_unregister_all(GAttrib *attrib)
{
+ if (!attrib)
+ return false;
+
return bt_att_unregister_all(attrib->att);
}