[PATCH 5/5] uefirtvariable: allow large sizes for variable names

Ricardo Neri ricardo.neri-calderon at linux.intel.com
Wed Feb 11 02:30:18 UTC 2015


On Tue, 2015-02-10 at 14:13 +0000, Colin Ian King wrote:
> If realloc fails, the original allocation is left untouched and not
> freed (or moved) and variablename is assigned NULL. This will lead to
> a
> small memory leak. Perhaps:
>                                 uint16_t *tmp;
> 
>                                 tmp = realloc(variablename,
>                                         sizeof(uint16_t) *
> variablenamesize);
>                                 if (!tmp) {
>                                         fwts_skipped(fw, "Unable to
> reallocate memory for variable name");
>                                         free(variablename);
>                                         return FWTS_SKIP;
>                                 }
Ah, this is a good catch. I will resubmit with the appropriate logic.

Thanks and BR,
Ricardo




More information about the fwts-devel mailing list