diff options
author | OpenGnSys Support Team <soporte-og@soleta.eu> | 2020-03-26 10:45:51 +0100 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2020-03-26 11:45:19 +0100 |
commit | 9cf5bf7181a0e60e17514ed5075d628b1b04b22e (patch) | |
tree | b9b1dbea71bd1f25595f8f54fe0291b2b5541a0e /admin/Sources | |
parent | 2a193c5515f756f863da5b4c7867d0ccfd66ae18 (diff) |
#941 Missing error in actualizaSoftware() and memleak in result
This patch fixes e052fdceec013 that adds a missing error in case
the insertion fails. This also releases the result in case the
entry exists.
Diffstat (limited to 'admin/Sources')
-rw-r--r-- | admin/Sources/Services/ogAdmServer/sources/ogAdmServer.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.c b/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.c index d4a04d28..322d2f28 100644 --- a/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.c +++ b/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.c @@ -2372,16 +2372,17 @@ bool actualizaSoftware(struct og_dbi *dbi, char *sft, char *par,char *ido, " VALUES(2,'%s',%s,0)", tbSoftware[i], idc); if (!result) { // Error al insertar dbi_conn_error(dbi->conn, &msglog); - og_info((char *)msglog); + syslog(LOG_ERR, "failed to query database (%s:%d) %s\n", + __func__, __LINE__, msglog); return false; } - dbi_result_free(result); // Recupera el identificador del software tbidsoftware[i] = dbi_conn_sequence_last(dbi->conn, NULL); } else { tbidsoftware[i] = dbi_result_get_uint(result, "idsoftware"); } + dbi_result_free(result); } // Ordena tabla de identificadores para cosultar si existe un pefil con esas especificaciones |