mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
Add missing free() for line that is malloc()'d by getline().
This commit is contained in:
parent
52f3043f15
commit
eeaf162626
@ -172,7 +172,7 @@ static int _get_proc_number(const char *file, const char *name,
|
|||||||
{
|
{
|
||||||
FILE *fl;
|
FILE *fl;
|
||||||
char nm[256];
|
char nm[256];
|
||||||
char *line;
|
char *line = NULL;
|
||||||
size_t len;
|
size_t len;
|
||||||
uint32_t num;
|
uint32_t num;
|
||||||
|
|
||||||
@ -188,6 +188,7 @@ static int _get_proc_number(const char *file, const char *name,
|
|||||||
*number = num;
|
*number = num;
|
||||||
if (fclose(fl))
|
if (fclose(fl))
|
||||||
log_sys_error("fclose", file);
|
log_sys_error("fclose", file);
|
||||||
|
free(line);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
dm_bit_set(_dm_bitset, num);
|
dm_bit_set(_dm_bitset, num);
|
||||||
@ -196,6 +197,7 @@ static int _get_proc_number(const char *file, const char *name,
|
|||||||
}
|
}
|
||||||
if (fclose(fl))
|
if (fclose(fl))
|
||||||
log_sys_error("fclose", file);
|
log_sys_error("fclose", file);
|
||||||
|
free(line);
|
||||||
|
|
||||||
if (number) {
|
if (number) {
|
||||||
log_error("%s: No entry for %s found", file, name);
|
log_error("%s: No entry for %s found", file, name);
|
||||||
|
Loading…
Reference in New Issue
Block a user