diff options
author | Roberto Hueso Gómez <rhueso@soleta.eu> | 2019-12-11 10:45:18 +0100 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2020-03-07 13:22:56 +0100 |
commit | fe20a3ce89efec3b9a2b78dcd79b2b0f25c1f12e (patch) | |
tree | 5c3ad0a24e18dd020395ee2cc6e46dcb2f344d1c | |
parent | ab71ca861917c851cab23e5527dc7baca968e273 (diff) |
#580 Fix uninitialized variables in ogAdmServer
This patch ensures that some variables are initialized before using them.
-rw-r--r-- | admin/Sources/Services/ogAdmServer/sources/ogAdmServer.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.c b/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.c index 562a39de..fa8b487a 100644 --- a/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.c +++ b/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.c @@ -1961,7 +1961,9 @@ static bool RESPUESTA_InventarioHardware(TRAMA* ptrTrama, struct og_client *cli) if (buffer) res=actualizaHardware(dbi, buffer, ido, npc, idc); - + else + res = false; + liberaMemoria(iph); liberaMemoria(ido); liberaMemoria(npc); @@ -2290,6 +2292,8 @@ static bool RESPUESTA_InventarioSoftware(TRAMA* ptrTrama, struct og_client *cli) buffer = rTrim(leeArchivo(sft)); if (buffer) res=actualizaSoftware(dbi, buffer, par, ido, npc, idc); + else + res = false; liberaMemoria(iph); liberaMemoria(ido); @@ -2366,6 +2370,7 @@ bool actualizaSoftware(struct og_dbi *dbi, char *sft, char *par,char *ido, if (lon > MAXSOFTWARE) lon = MAXSOFTWARE; // Limita el número de componentes software + idnombreso = 0; for (i = 0; i < lon; i++) { // Primera línea es el sistema operativo: se obtiene identificador if (i == 0) { |