Skip to content

Commit

Permalink
SSS_INI: remove 'const' specifier from getter
Browse files Browse the repository at this point in the history
`sss_ini_get_string_config_value()` is a wrapper around
`ini_get_string_config_value()`, whose docs says
```
Returned value needs to be freed after use.
```
But an attempt to free 'const char *' results in discarded-qualifiers
warning.
  • Loading branch information
alexey-tikhonov committed Oct 18, 2023
1 parent f0f024d commit 386ed5d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/tools/sssd_check_socket_activated_responders.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
static errno_t check_socket_activated_responder(const char *responder)
{
errno_t ret;
const char *services;
char *services = NULL;
const char *str;
TALLOC_CTX *tmp_ctx;
struct sss_ini *init_data;
Expand Down Expand Up @@ -90,6 +90,7 @@ static errno_t check_socket_activated_responder(const char *responder)
ret = EOK;

done:
free(services);
talloc_free(tmp_ctx);

return ret;
Expand Down
2 changes: 1 addition & 1 deletion src/util/sss_ini.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ int sss_ini_get_int_config_value(struct sss_ini *self,

/* Get string value */

const char *sss_ini_get_string_config_value(struct sss_ini *self,
char *sss_ini_get_string_config_value(struct sss_ini *self,
int *error)
{
return ini_get_string_config_value(self->obj, error);
Expand Down
2 changes: 1 addition & 1 deletion src/util/sss_ini.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ int sss_ini_get_int_config_value(struct sss_ini *self,
/**
* @brief Get string value
*/
const char *sss_ini_get_string_config_value(struct sss_ini *self,
char *sss_ini_get_string_config_value(struct sss_ini *self,
int *error);

/**
Expand Down

0 comments on commit 386ed5d

Please sign in to comment.