This patch fixes getline memory leakage when parsing dynamic major num.
Fixes:
7d62bf6f54ba ("net/virtio: introduce vhost-vDPA backend type")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
{
FILE *fp;
char *line = NULL;
- size_t size;
+ size_t size = 0;
char name[11];
bool found = false;
uint32_t num;
break;
}
}
+ free(line);
fclose(fp);
return found ? num : UNNAMED_MAJOR;
}