tcap_test: enable talloc report on exit
This commit is contained in:
parent
2b0e73f42a
commit
c29cc7c826
|
@ -2,6 +2,7 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
||||||
|
@ -121,11 +122,26 @@ static int initialize(void)
|
||||||
ARRAY_SIZE(gprsLocationUpdateContext_v3));
|
ARRAY_SIZE(gprsLocationUpdateContext_v3));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void signal_handler(int signal)
|
||||||
|
{
|
||||||
|
switch (signal) {
|
||||||
|
case SIGINT:
|
||||||
|
talloc_report_full(NULL, stderr);
|
||||||
|
exit(0);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
struct sockaddr_storage ss;
|
struct sockaddr_storage ss;
|
||||||
struct sockaddr_in *sin = (struct sockaddr_in *)&ss;
|
struct sockaddr_in *sin = (struct sockaddr_in *)&ss;
|
||||||
|
|
||||||
|
talloc_enable_leak_report_full();
|
||||||
|
signal(SIGINT, &signal_handler);
|
||||||
|
|
||||||
initialize();
|
initialize();
|
||||||
|
|
||||||
ss.ss_family = AF_INET;
|
ss.ss_family = AF_INET;
|
||||||
|
|
Loading…
Reference in New Issue