Code

data: Don't free memory before using it for the last time.
[sysdb.git] / src / core / data.c
index a796b21eef37a57c4cc422836f5386f5c11c14ba..557dfd6a5fb3011d276c22ccb31442edaaf59ff1 100644 (file)
@@ -602,9 +602,9 @@ sdb_data_parse(char *str, int type, sdb_data_t *data)
                                return -1;
                        if (regcomp(&tmp.data.re.regex, tmp.data.re.raw,
                                                REG_EXTENDED | REG_ICASE | REG_NOSUB)) {
-                               free(tmp.data.re.raw);
                                sdb_log(SDB_LOG_ERR, "core: Failed to compile regular "
                                                "expression '%s'", tmp.data.re.raw);
+                               free(tmp.data.re.raw);
                                return -1;
                        }
                        if (! data) {