_vine_data_path_create(VINE_DATA_PATH_TYPE_CLIENT, security, ip, port, NULL, event_fd);
RET_VAL_IF(dp == NULL, VINE_ERROR_OUT_OF_MEMORY, "Out of memory");
+ if (dp->addr)
+ free(dp->addr);
dp->addr = STRDUP(ip);
dp->port = port;
dp->connected_cb = callback;
RET_VAL_IF(ca_path == NULL, VINE_ERROR_INVALID_PARAMETER, "ca_path is NULL");
vine_security_s *s = (vine_security_s *)security;
+ if (s->ca_path)
+ free(s->ca_path);
s->ca_path = STRDUP(ca_path);
return VINE_ERROR_NONE;
RET_VAL_IF(cert_path == NULL, VINE_ERROR_INVALID_PARAMETER, "cert_path is NULL");
vine_security_s *s = (vine_security_s *)security;
+ if (s->cert_path)
+ free(s->cert_path);
s->cert_path = STRDUP(cert_path);
return VINE_ERROR_NONE;
RET_VAL_IF(key_path == NULL, VINE_ERROR_INVALID_PARAMETER, "key_path is NULL");
vine_security_s *s = (vine_security_s *)security;
+ if (s->key_path)
+ free(s->key_path);
s->key_path = STRDUP(key_path);
return VINE_ERROR_NONE;
RET_VAL_IF(psk == NULL, VINE_ERROR_INVALID_PARAMETER, "psk is NULL");
vine_security_s *s = (vine_security_s *)security;
+ if (s->psk)
+ free(s->psk);
s->psk = STRDUP(psk);
return VINE_ERROR_NONE;