Since
5084091a, @tmp is filled by a g_key_file_get_string which is
now an allocated string as opposed to some hash table lookup value,
so we need to treat it as so.
Found by Coverity
Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
}
for (ninteract = 0; state->interact[ninteract].id != 0; ninteract++) {
- const char *value = NULL;
+ char *value = NULL;
switch (state->interact[ninteract].id) {
case SASL_CB_USER:
char **value)
{
g_autoptr(virAuthConfig) config = NULL;
- const char *tmp;
*value = NULL;
servicename,
hostname,
credname,
- &tmp) < 0)
+ value) < 0)
return -1;
- *value = g_strdup(tmp);
-
return 0;
}
const char *service,
const char *hostname,
const char *credname,
- const char **value)
+ char **value)
{
g_autofree char *authgroup = NULL;
g_autofree char *credgroup = NULL;
const char *service,
const char *hostname,
const char *credname,
- const char **value);
+ char **value);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virAuthConfig, virAuthConfigFree);
static int testAuthLookup(const void *args)
{
const struct ConfigLookupData *data = args;
- const char *actual = NULL;
+ g_autofree char *actual = NULL;
int rv;
rv = virAuthConfigLookup(data->config,