diff -urp libselinux-2.0.0.orig/src/matchpathcon.c libselinux-2.0.0/src/matchpathcon.c --- libselinux-2.0.0.orig/src/matchpathcon.c 2007-02-19 20:57:53.000000000 -0500 +++ libselinux-2.0.0/src/matchpathcon.c 2007-02-19 21:11:11.000000000 -0500 @@ -445,9 +445,9 @@ static int process_line(const char *path { int items, len, regerr, ret; char *buf_p, *ptr; - char *regex, *type, *context; + char *regex=NULL, *type=NULL, *context=NULL; const char *reg_buf; - char *anchored_regex; + char *anchored_regex = NULL; ret = 0; len = strlen(line_buf); @@ -543,9 +543,12 @@ static int process_line(const char *path path, lineno, anchored_regex, (errbuf ? errbuf : "out of memory")); free(anchored_regex); + anchored_regex = NULL; + free(errbuf); goto finish; } free(anchored_regex); + anchored_regex = NULL; /* Convert the type string to a mode format */ spec_arr[nspec].type_str = type; @@ -718,6 +721,7 @@ int matchpathcon_init_prefix(const char } } free(line_buf); + line_buf = NULL; /* Move exact pathname specifications to the end. */ spec_copy = malloc(sizeof(spec_t) * nspec); @@ -740,6 +744,7 @@ int matchpathcon_init_prefix(const char status = 0; finish: fclose(fp); + free(line_buf); if (spec_arr != spec_copy) free(spec_arr); if (homedirfp)