i've got a qestion, i'm using sourgery c++ toolchain, and the compiler leave me to write this sentence:
for(i=0;i<size_of_categories;i++){
    size_t size_of_tmp = sizeof(char) * (HOSTLINK_CONFIG_STRING_MAX_LEN * (categories[i].key_len));
    char tmp[size_of_tmp];
    memset(tmp,0,(size_of_tmp));    
    get_hostlink_count[i]++;
    if(categories[i].time == get_hostlink_count[i]){
        if(format == CSV){
            csv_this_category_values(categories,i,tmp,size_of_tmp);
            strncat(buffer,tmp,buff_len);
        }else if (format == JSON){
            xi_json_this_category_values(categories,i,tmp,size_of_tmp);
            js_this_cat = json_loads(tmp,JSON_DECODE_ANY,NULL);
            json_array_extend(js_arr,js_this_cat);
            json_array_clear(js_this_cat);
            json_decref(js_this_cat);
        }
        get_hostlink_count[i] = 0;
    }
    //Free(tmp);
}
My issue is this sentece alloc memory in stack or in the heap? This could cause memory leak because is made in a for loop? Is this equivalent to make a malloc and at the end of the loop a Free?
size_t size_of_tmp = sizeof(char) * (HOSTLINK_CONFIG_STRING_MAX_LEN * (categories[i].key_len));
    char tmp[size_of_tmp];
 
     
    