mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-08 20:03:34 +02:00
file_storage: Use autopointers
This commit is contained in:
committed by
Benjamin Berg
parent
1ae0f4926d
commit
6a5d46c8b0
@ -79,7 +79,7 @@ static char *get_path_to_storedir(const char *driver, const char * device_id, ch
|
|||||||
static char *__get_path_to_print(const char *driver, const char * device_id,
|
static char *__get_path_to_print(const char *driver, const char * device_id,
|
||||||
FpFinger finger, char *base_store)
|
FpFinger finger, char *base_store)
|
||||||
{
|
{
|
||||||
char *dirpath;
|
g_autofree char *dirpath = NULL;
|
||||||
char *path;
|
char *path;
|
||||||
char fingername[2];
|
char fingername[2];
|
||||||
|
|
||||||
@ -87,7 +87,6 @@ static char *__get_path_to_print(const char *driver, const char * device_id,
|
|||||||
|
|
||||||
dirpath = get_path_to_storedir(driver, device_id, base_store);
|
dirpath = get_path_to_storedir(driver, device_id, base_store);
|
||||||
path = g_build_filename(dirpath, fingername, NULL);
|
path = g_build_filename(dirpath, fingername, NULL);
|
||||||
g_free(dirpath);
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,7 +187,7 @@ int file_storage_print_data_load(FpDevice *dev,
|
|||||||
{
|
{
|
||||||
g_autofree gchar *path = NULL;
|
g_autofree gchar *path = NULL;
|
||||||
g_autofree gchar *base_store = NULL;
|
g_autofree gchar *base_store = NULL;
|
||||||
FpPrint *new = NULL;
|
g_autoptr(FpPrint) new = NULL;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
base_store = file_storage_get_basestore_for_username(username);
|
base_store = file_storage_get_basestore_for_username(username);
|
||||||
@ -201,11 +200,10 @@ int file_storage_print_data_load(FpDevice *dev,
|
|||||||
return r;
|
return r;
|
||||||
|
|
||||||
if (!fp_print_compatible (new, dev)) {
|
if (!fp_print_compatible (new, dev)) {
|
||||||
g_object_unref (new);
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
*print = new;
|
*print = g_steal_pointer (&new);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user