config: Ensure that stolen option list elements are released.
NewInputDeviceRequest steals the contents of option list elements but doesn't use the elements themselves for anything. Therefore the list elements need to be released always. Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
8d30aff4aa
commit
4114533db6
|
@ -392,10 +392,10 @@ unwind:
|
||||||
free(driver);
|
free(driver);
|
||||||
free(name);
|
free(name);
|
||||||
free(config_info);
|
free(config_info);
|
||||||
while (!dev && (tmpo = options)) {
|
while ((tmpo = options)) {
|
||||||
options = tmpo->next;
|
options = tmpo->next;
|
||||||
free(tmpo->key);
|
free(tmpo->key); /* NULL if dev != NULL */
|
||||||
free(tmpo->value);
|
free(tmpo->value); /* NULL if dev != NULL */
|
||||||
free(tmpo);
|
free(tmpo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -197,10 +197,10 @@ device_added(struct udev_device *udev_device)
|
||||||
|
|
||||||
unwind:
|
unwind:
|
||||||
free(config_info);
|
free(config_info);
|
||||||
while (!dev && (tmpo = options)) {
|
while ((tmpo = options)) {
|
||||||
options = tmpo->next;
|
options = tmpo->next;
|
||||||
free(tmpo->key);
|
free(tmpo->key); /* NULL if dev != NULL */
|
||||||
free(tmpo->value);
|
free(tmpo->value); /* NULL if dev != NULL */
|
||||||
free(tmpo);
|
free(tmpo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user