|
From: Peter K. <pk...@us...> - 2001-10-12 14:56:43
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_if.c 1.38 1.39=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Free allocated memory in bt_inquiry() (thanks to Andreas Petralia).
The diff of the modified file(s):
--- bt_if.c 2001/10/12 12:01:16 1.38
+++ bt_if.c 2001/10/12 14:56:41 1.39
@@ -680,7 +680,11 @@
int i;
inquiry_results *inq_res;
=20
- inq_res =3D (inquiry_results*) malloc(sizeof(inquiry_results) + nbr_rsp =
* 6);
+ if (!(inq_res =3D malloc(sizeof *inq_res + nbr_rsp * 6)))
+ {
+ fprintf(stderr, __FUNCTION__ ": Failed to allocate result structure!\n=
");
+ }
+
inq_res->nbr_of_units =3D nbr_rsp;
inq_res->inq_time =3D t;
=20
@@ -697,6 +701,8 @@
inq_res->bd_addr[2+6*i], inq_res->bd_addr[3+6*i],
inq_res->bd_addr[4+6*i], inq_res->bd_addr[5+6*i]);
}
+
+ free(inq_res);
#endif
}
=20
|