diff options
Diffstat (limited to 'battstat/acpi-linux.c')
-rw-r--r-- | battstat/acpi-linux.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/battstat/acpi-linux.c b/battstat/acpi-linux.c index 3ac91c29..6f9512ce 100644 --- a/battstat/acpi-linux.c +++ b/battstat/acpi-linux.c @@ -350,22 +350,28 @@ gboolean acpi_process_event(struct acpi_info * acpiinfo) buffer=g_string_new(NULL); g_io_channel_read_line_string ( acpiinfo->channel,buffer,&i,&gerror); + gboolean result; evt = parse_acpi_event(buffer); switch (evt) { case ACPI_EVENT_AC: - return update_ac_info(acpiinfo); + result = update_ac_info(acpiinfo); + break; case ACPI_EVENT_BATTERY_INFO: if (update_battery_info(acpiinfo)) { /* Update AC info on battery info updates. This works around * a bug in ACPI (as per bug #163013). */ - return update_ac_info(acpiinfo); + result = update_ac_info(acpiinfo); + break; } /* fall-through */ default: - return FALSE; + result = FALSE; } + + g_string_free(buffer, FALSE); + return result; } /* |