attrib-server: Allow zero length attribute update
attrib-server: Allow zero length attribute update

attrib_db_update always fails when g_try_realloc returns NULL, not
taking into account that the length passed to g_try_realloc could be
zero. In this case, g_try_realloc frees the currently allocated memory
and returns NULL.
As a result, not only will attrib_db_update fail needlessly, a
use-after-free could occur as the attribute's length will still hold the
length of the freed buffer.

Fix this by only returning an error if the length is non-zero.

mapfau/bluez,pkarasev3/bluez,pkarasev3/bluez,pkarasev3/bluez,mapfau/bluez,silent-snowman/bluez,pstglia/external-bluetooth-bluez,pstglia/external-bluetooth-bluez,silent-snowman/bluez,ComputeCycles/bluez,silent-snowman/bluez,pkarasev3/bluez,mapfau/bluez,mapfau/bluez,silent-snowman/bluez,ComputeCycles/bluez,ComputeCycles/bluez,ComputeCycles/bluez,pstglia/external-bluetooth-bluez,pstglia/external-bluetooth-bluez