libmultipath: memory leak in iet.c
authorHannes Reinecke <hare@suse.de>
Wed, 15 Jun 2016 09:18:18 +0000 (11:18 +0200)
committerHannes Reinecke <hare@suse.de>
Thu, 16 Jun 2016 08:49:54 +0000 (10:49 +0200)
'pmatch' was never freed.
Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
libmultipath/prioritizers/iet.c

index 0bcc48b..3549665 100644 (file)
@@ -59,10 +59,11 @@ char *find_regex(char * string, char * regex)
                                if (result) {
                                        strncpy(result, &string[start], size);
                                        result[size] = '\0';
+                                       free(pmatch);
                                        return result;
                                }
                        }
-                       else return NULL;
+                       free(pmatch);
                }
        }
        return NULL;