I am trying to allocate memory in this situation, actually i did what i wanted but im wondering is there any better way or is there something i did wrong .
I just trying to code functional as much as possible what else can i do for this .
void createDATABASE(int uint_val,int int_val,int str_val,int dbl_val)
{
    int *decision=(int*)malloc(4*sizeof(int));
    int i;
    dbStore tdbStore;
    t_CreateDatabase tCreateDatabase;
    signal(SIGINT,err_memleak); // SIGNAL PROCESSING
    memcpy(tCreateDatabase.filename,"test.bin",32); // database name copied
    decision[0] = uint_val; decision[1] = int_val;
    decision[2] = str_val; decision[3] = dbl_val;
    for(i=0;i<4;i++){
        if(decision[i] > 0){
            switch(i){
                case 0:
                    tdbStore.unsig_int = u_intAllocate(uint_val);
                    if(tdbStore.unsig_int==NULL) raise(SIGINT);
                    break;
                case 1:
                    tdbStore.sig_int = n_intAllocate(int_val);
                    if(tdbStore.sig_int==NULL) raise(SIGINT);
                    break;
                case 2:
                    tdbStore.strings = strAllocate(str_val);
                    if(tdbStore.strings==NULL) raise(SIGINT);
                    break;
                case 3:
                    tdbStore.big_int = d_intAllocate(dbl_val);
                    if(tdbStore.big_int==NULL) raise(SIGINT);
                    break;
            }
        }
    }
}
char **strAllocate(int val)
{
    int column=1024,l;
    char **node = (char**)malloc(val*sizeof(char*));
    for(l=0;l<val;l++)
        node[l] = (char*)malloc(column*sizeof(char));
    return node;
}
double *d_intAllocate(int val)
{
    double *node = (double*)malloc(val*sizeof(double));
    return node;
}
unsigned int *u_intAllocate(int val)
{
    unsigned int *node = (unsigned int*)malloc(val*sizeof(unsigned int));
    return node;
}
int *n_intAllocate(int val)
{
    int *node = (int*)malloc(val*sizeof(int));
    return node;
}
Thanks for advises..
 
     
    