Grant Limberg před 4 roky
rodič
revize
43c108f077
1 změnil soubory, kde provedl 2 přidání a 0 odebrání
  1. 2 0
      controller/PostgreSQL.cpp

+ 2 - 0
controller/PostgreSQL.cpp

@@ -1399,6 +1399,7 @@ void PostgreSQL::commitThread()
 						PQclear(res);
 					}
 					if (err) {
+						PQclear(res);
 						PQclear(PQexec(conn, "ROLLBACK"));
 						delete config;
 						config = nullptr;
@@ -1502,6 +1503,7 @@ void PostgreSQL::commitThread()
 					if (PQresultStatus(res) != PGRES_COMMAND_OK) {
 						fprintf(stderr, "ERROR: Error updating DNS: %s\n", PQresultErrorMessage(res));
 						PQclear(res);
+						PQclear(PQexec(conn, "ROLLBACK"));
 						err = true;
 						break;
 					}