summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2020-06-08 18:06:14 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2020-06-08 18:06:25 +0200
commit2ddbf09ce21c3afb9462f05841c6a6442b5ba245 (patch)
treeda374820101c6b3cdf89b614def52b377d9bb36a
parent8f1983e9a1591b2a61a1737068ca0adae63f798d (diff)
#971 replace reservaMemoria() by calloc()
-rw-r--r--admin/Sources/Services/ogAdmServer/sources/ogAdmServer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.c b/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.c
index 0b1748a5..ec6a94f7 100644
--- a/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.c
+++ b/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.c
@@ -990,7 +990,7 @@ bool actualizaHardware(struct og_dbi *dbi, char *hrd, char *ido, char *npc,
/* Crea cadena de identificadores de componentes hardware separados por coma */
sprintf(strInt, "%d", tbidhardware[lon - 1]); // Pasa a cadena el Ășltimo identificador que es de mayor longitud
aux = strlen(strInt); // Calcula longitud de cadena para reservar espacio a todos los perfiles
- idhardwares = reservaMemoria(sizeof(aux) * lon + lon);
+ idhardwares = calloc(1, sizeof(aux) * lon + lon);
if (idhardwares == NULL) {
syslog(LOG_ERR, "%s:%d OOM\n", __FILE__, __LINE__);
return false;
@@ -1250,7 +1250,7 @@ bool actualizaSoftware(struct og_dbi *dbi, char *sft, char *par,char *ido,
/* Crea cadena de identificadores de componentes software separados por coma */
sprintf(strInt, "%d", tbidsoftware[lon - 1]); // Pasa a cadena el Ășltimo identificador que es de mayor longitud
aux = strlen(strInt); // Calcula longitud de cadena para reservar espacio a todos los perfiles
- idsoftwares = reservaMemoria((sizeof(aux)+1) * lon + lon);
+ idsoftwares = calloc(1, (sizeof(aux)+1) * lon + lon);
if (idsoftwares == NULL) {
syslog(LOG_ERR, "%s:%d OOM\n", __FILE__, __LINE__);
return false;
@@ -1444,7 +1444,7 @@ static TRAMA *og_msg_alloc(char *data, unsigned int len)
{
TRAMA *ptrTrama;
- ptrTrama = (TRAMA *)reservaMemoria(sizeof(TRAMA));
+ ptrTrama = calloc(1, sizeof(TRAMA));
if (!ptrTrama) {
syslog(LOG_ERR, "OOM\n");
return NULL;