]> granicus.if.org Git - cronie/commitdiff
Free security contexts.
authorMarcela Mašláňová <mmaslano@redhat.com>
Mon, 21 Feb 2011 12:29:17 +0000 (13:29 +0100)
committerMarcela Mašláňová <mmaslano@redhat.com>
Mon, 21 Feb 2011 12:29:17 +0000 (13:29 +0100)
src/security.c

index bdc32f4b2fd10826852f801dd7859e964ab42907..6f6ff39a988eb643263e179287ad953485f1b357 100644 (file)
@@ -333,18 +333,21 @@ cron_get_job_range(user * u, security_context_t * ucontextp, char **jobenv) {
                if (!(ccon = context_new(u->scontext))) {
                        log_it(u->name, getpid(), "context_new FAILED for MLS_LEVEL",
                                range, 0);
+                       context_free(ccon);
                        return -1;
                }
 
                if (context_range_set(ccon, range)) {
                        log_it(u->name, getpid(),
                                "context_range_set FAILED for MLS_LEVEL", range, 0);
+                       context_free(ccon);
                        return -1;
                }
 
                if (!(*ucontextp = context_str(ccon))) {
                        log_it(u->name, getpid(), "context_str FAILED for MLS_LEVEL",
                                range, 0);
+                       context_free(ccon);
                        return -1;
                }