:: [DNG] int essid_alloc is causing va…
Forside
Slet denne besked
Besvar denne besked
Skribent: Edward Bartolo
Dato:  
Til: dng
Emne: [DNG] int essid_alloc is causing valgrind to report a series of errors
Dear All,

The problem according to my logic seems to be result is used in a
branch control expression before it is initialised. However, I am
emailing this to have other opinions.


int essid_alloc(
    size_t length,
    char ** result
) {
    char * tmp;


    if(length==0 || !result)
        return EINVAL;


    tmp = (char *) calloc(length, 1);


    if(!tmp)
        return ENOMEM;


    *result = tmp;

    
    return 0;
}