Skip to content
Browse files

[eglib] Fix a possible memory leak.

  • Loading branch information...
1 parent 87bbf05 commit 20149a0ecc360b373eb7e8f0e1e38533b0cb1677 @kumpera kumpera committed Jan 16, 2014
Showing with 3 additions and 2 deletions.
  1. +3 −2 eglib/src/gpath.c
View
5 eglib/src/gpath.c
@@ -216,8 +216,8 @@ strtok_r(char *s, const char *delim, char **last)
gchar *
g_find_program_in_path (const gchar *program)
{
- char *p = g_strdup (g_getenv ("PATH"));
- char *x = p, *l;
+ char *p;
+ char *x, *l;
gchar *curdir = NULL;
char *save = NULL;
#ifdef G_OS_WIN32
@@ -228,6 +228,7 @@ g_find_program_in_path (const gchar *program)
#endif
g_return_val_if_fail (program != NULL, NULL);
+ x = p = g_strdup (g_getenv ("PATH"));
if (x == NULL || *x == '\0') {
curdir = g_get_current_dir ();

0 comments on commit 20149a0

Please sign in to comment.
Something went wrong with that request. Please try again.