Problem in C and LVGL with pointers, struct in struct and malloc

Hello Dear friends.
I have a problem with memory allocation in C and LVGL. The first part is the definitions.

typedef struct
{
    unsigned char Widgetcount;
    unsigned char index;
    lv_obj_t * btn[];
}AssetRADIOBUTTON;

typedef struct{

    lv_obj_t * tab;
    AssetRADIOBUTTON * Radio1;

}AssetSettingsSome;

typedef struct{
    
    lv_obj_t * ScreenMenuModule;
    unsinged char radioCOUNT;
    AssetSettingsSome Some;

}GUI_STRUCT_MODULES;

Now for initialization, if I call the memory allocation in subfunction, which works, in the subsubfunction with present code, it doesn’t work.
Code which works:

void CreateRadioButton(AssetRADIOBUTTON * Radio,lv_obj_t * tab,unsigned char RadioCount)
{
   Radio->Widgetcount = RadioCount;
   for(unsigned char i=0;i<RadioCount;i++)
       Radio->btn[i] = lv_checkbox_create(tab);
   Radio->index = 0;
}
void CreateDialog(GUI_STRUCT_MODULES * Settings)
{
   Settings->radioCOUNT = 4;
   Settings->Some.Radio1 = malloc(sizeof(*Settings->Some.Radio1) + Settings->radioCOUNT * sizeof(*Settings->Some.Radio1->btn));
   CreateRadioButton(Settings->Some.Radio1,Settings->ECG.tab,4);
}
void main(void)
{
    static GUI_STRUCT_MODULES GUI_MODULES;
    CreateDialog(&GUI_MODULES);
}

Code Which doesn’t work

void CreateRadioButton(AssetRADIOBUTTON * Radio,lv_obj_t * tab,unsigned char RadioCount)
{
    Radio = malloc(sizeof(*Radio) + RadioCount * sizeof(*Radio->btn));
    Radio->Widgetcount = RadioCount;
    for(unsigned char i=0;i<RadioCount;i++)
        Radio->btn[i] = lv_checkbox_create(tab);
    Radio->index = 0;
}
void CreateDialog(GUI_STRUCT_MODULES * Settings)
{
   CreateRadioButton(Settings->Some.Radio1,Settings->ECG.tab,4);
}
void main(void)
{
    static GUI_STRUCT_MODULES GUI_MODULES;
    CreateDialog(&GUI_MODULES);
}    

Sorry for a bit long MVP.

you are passing an uninitialized pointer by value to your function. There you assign the malloc pointer, but you are not storing this in your Settings as intended.
You need to pass the address of the pointer and do malloc on the dereferenced address (which is the settings pointer).

CreateRadioButton(&Settings->Some.Radio1,Settings->ECG.tab,4);

(*Radio) = malloc(...);
(*Radio)->Widgetcount = ...;

a temporary pointer can make it more readable:

CreateRadioButton(...)
{
    AssetRADIOBUTTON *pRadio = *Radio;
    pRadio = malloc();
   pRadio->Widgetcount = ...;
}

Thank you for your answer, your answer is correct, but some other person answered me more completely in this QA