kopia lustrzana https://github.com/Hamlib/Hamlib
Fix memory leak in rigctl_parse.c
strip_quotes() orphaned 1 or 2 strings per call.pull/1771/head
rodzic
aa39d6a618
commit
0740af61a3
|
@ -497,9 +497,9 @@ void hash_delete_all()
|
||||||
|
|
||||||
|
|
||||||
// modifies s to remove quotes
|
// modifies s to remove quotes
|
||||||
void strip_quotes(char *s)
|
static void strip_quotes(char *s)
|
||||||
{
|
{
|
||||||
char *s2 = strdup(s);
|
char *s2;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
if (s[0] != '\"') { return; } // no quotes
|
if (s[0] != '\"') { return; } // no quotes
|
||||||
|
@ -510,6 +510,7 @@ void strip_quotes(char *s)
|
||||||
if (p) { *p = 0; }
|
if (p) { *p = 0; }
|
||||||
|
|
||||||
strcpy(s, s2);
|
strcpy(s, s2);
|
||||||
|
free(s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBREADLINE
|
#ifdef HAVE_LIBREADLINE
|
||||||
|
|
Ładowanie…
Reference in New Issue