Commit dc24d2d
committed
libebgenv: Only release CONFIG_PART::mountpoint early on errors
This fixes a regression caused by premature cleanup: If
probe_config_file() ran successfully and found an already mounted
partition, its mountpoint must not be released yet. bgenv_finalize()
will take care of that.
However, if probe_config_file() failed, it must free any previously
created mountpoint string prior to returning. That is what c2be7c1
was actually trying to resolve.
But as we are no longer freeing in probe_config_file on success, we need
to free on errors in probe_config_partitions. This was found by coverity
after only changing probe_config_file.
Reported-by: Ingo Rah <ingo.rah@linutronix.de>
Fixes: c2be7c1 ("libebgenv: fix memory leak in partition probing")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>1 parent c6fc548 commit dc24d2d
2 files changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
| |||
0 commit comments