All pastes #171172 Raw Edit

stupid splint

public c v1 · immutable
·published 2006-09-15 03:27 UTC
rendered paste body
#include <stdlib.h>typedef struct MyTest MyTest;struct MyTest{	/*@null@*/ /*@only@*/ void *data;};/*@null@*/ static MyTest *my_test_new (void){	MyTest *test;	test = (MyTest *) malloc (sizeof (MyTest));	if (!test)	{		return NULL;	}	memset (test, 0, sizeof (MyTest));	test->data = malloc (100);	return test;}static voidmy_test_free (/*@only@*/ /*@null@*/ MyTest *test){	if (!test)	{		return;	}	if (test->data)	{		free (test->data);	}	free (test);}intmain (/*@unused@*/ int argc,	  /*@unused@*/ char *argv[]){	/*@null@*/ MyTest *test;	test = my_test_new ();	my_test_free (test);	return 0;}