Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[config] Fix return type of find_mounts() and find_alt_mounts()
The prototypes for these functions claim to return const string, while
in reality it is dynamic memory that should released via g_free().

Change the prototypes to match the reality.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Jul 7, 2016
1 parent ed512dc commit 1fd5d72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/usb_moded-config.c
Expand Up @@ -66,10 +66,10 @@ static int validate_ip(const char *ipadd)
return 0;
}

const char *find_mounts(void)
char *find_mounts(void)
{

const char *ret = NULL;
char *ret = NULL;

ret = get_conf_string(FS_MOUNT_ENTRY, FS_MOUNT_KEY);
if(ret == NULL)
Expand All @@ -86,7 +86,7 @@ int find_sync(void)
return(get_conf_int(FS_SYNC_ENTRY, FS_SYNC_KEY));
}

const char * find_alt_mount(void)
char * find_alt_mount(void)
{
return(get_conf_string(ALT_MOUNT_ENTRY, ALT_MOUNT_KEY));
}
Expand Down
4 changes: 2 additions & 2 deletions src/usb_moded-config.h
Expand Up @@ -59,9 +59,9 @@
#define ANDROID_PRODUCT_ID_KEY "idProduct"
#define MODE_HIDE_KEY "hide"

const char * find_mounts(void);
char * find_mounts(void);
int find_sync(void);
const char * find_alt_mount(void);
char * find_alt_mount(void);

char * find_udev_path(void);
char * find_udev_subsystem(void);
Expand Down

0 comments on commit 1fd5d72

Please sign in to comment.