mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-09 04:13:33 +02:00
main: Ensure we always free context, loop and error
In case of early return we may not free them consistently, while this is not a big problem in a main function, is better to have a cleaner management, and we did get valgrind reports.
This commit is contained in:
@ -140,9 +140,9 @@ static gboolean sigterm_callback(gpointer data)
|
|||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
GOptionContext *context;
|
g_autoptr(GOptionContext) context = NULL;
|
||||||
GMainLoop *loop;
|
g_autoptr(GMainLoop) loop = NULL;
|
||||||
GError *error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
FprintManager *manager;
|
FprintManager *manager;
|
||||||
DBusGProxy *driver_proxy;
|
DBusGProxy *driver_proxy;
|
||||||
guint32 request_name_ret;
|
guint32 request_name_ret;
|
||||||
@ -158,7 +158,6 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
if (g_option_context_parse (context, &argc, &argv, &error) == FALSE) {
|
if (g_option_context_parse (context, &argc, &argv, &error) == FALSE) {
|
||||||
g_warning ("couldn't parse command-line options: %s\n", error->message);
|
g_warning ("couldn't parse command-line options: %s\n", error->message);
|
||||||
g_error_free (error);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user