pam_fprintd: Protect usage of strdup for NULL values

It's not smart as g_strdup, so need to ensure we don't use it for NULL
strings.

This is a regression caused by commit bf223662
This commit is contained in:
Marco Trevisan (Treviño)
2020-12-08 21:04:45 +01:00
parent 34f24cbe19
commit 944493e472

View File

@ -155,7 +155,7 @@ open_device (pam_handle_t *pamh,
sd_bus_message_exit_container (m); sd_bus_message_exit_container (m);
return strdup (path); return path ? strdup (path) : NULL;
} }
typedef struct typedef struct
@ -226,7 +226,7 @@ verify_result (sd_bus_message *m,
data->result = NULL; data->result = NULL;
} }
if (done) if (done && result)
{ {
data->result = strdup (result); data->result = strdup (result);
return 0; return 0;