It would seem you could just declare the variable as a static, i.e.
static char a[1000];
This will ensure that it is initialized the first time it is used but then persists on the heap for the life of the program.
It could be defined within the function or outside all of the other functions depending on the scope you wanted (e.g. you might want other local functions to be able to access that same character pointer). This way you don't have to worry about keeping track of malloc's and free's.