Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.dg/analyzer/CVE-2005-1689-minimal.c @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | 1830386684a0 |
children |
line wrap: on
line source
#include <stdlib.h> typedef struct _krb5_data { char *data; } krb5_data; void test_1 (krb5_data inbuf, int flag) { free(inbuf.data); /* { dg-message "first 'free' here" } */ free(inbuf.data); /* { dg-warning "double-'free' of 'inbuf.data'" } */ } void test_2 (krb5_data inbuf, int flag) { if (flag) { free(inbuf.data); /* { dg-message "first 'free' here" } */ } free(inbuf.data); /* { dg-warning "double-'free' of 'inbuf.data'" } */ } void test_3 (krb5_data inbuf, int flag) { if (flag) { free((char *)inbuf.data); /* { dg-message "first 'free' here" } */ } free((char *)inbuf.data); /* { dg-warning "double-'free' of 'inbuf.data'" } */ }