AnsweredAssumed Answered

Malloc problem

Question asked by Daniele Cortellazzi on Dec 11, 2015
Latest reply on Dec 16, 2015 by Daniele Cortellazzi

Hello,

 

i have this function:

 

IOTHUB_CLIENT_CONFIG* config = malloc(sizeof(IOTHUB_CLIENT_CONFIG));

        if (config == NULL)

        {

            /* SRS_IOTHUBCLIENT_LL_12_012: [If the allocation failed IoTHubClient_LL_CreateFromConnectionString  returns NULL]  */

            LogError("Malloc failed\r\n");

            return NULL;

        }

 

and always the malloc return a null pointer. Why? Isn't the code correct?

 

I didn't use MQX or FreeRTOS

 

Thanks

Outcomes