rem: memcpy(ptr->password.s, password, ptr->password.len + 1);
context: struct my_id* new_my_id(const char* url){	char* buf, *username, *password, *host, *port, *database;	int l;	struct my_id* ptr;	if (!url) {		LOG(L_ERR, "new_my_id(): Invalid parameter\n");		return 0;	}	     /* Make a scratch-pad copy of the url */	l = strlen(url);	buf = (char*)pkg_malloc(l + 1);	if (!buf) {		LOG(L_ERR, "new_my_id(): Not enough memory\n");		return 0;	}	memcpy(buf, url, l + 1);	ptr = (struct my_id*)pkg_malloc(sizeof(struct my_id));	if (!ptr) {		LOG(L_ERR, "new_my_id(): No memory left\n");		goto err;	}	memset(ptr, 0, sizeof(struct my_id));	if (parse_mysql_url(buf, &username, &password, &host, &port, &database) < 0) {		LOG(L_ERR, "new_my_id(): Error while parsing mysql URL: %s\n", url);		goto err;	}	ptr->username.len = strlen(username);	ptr->username.s = (char*)pkg_malloc(ptr->username.len + 1);	if (!ptr->username.s) {		LOG(L_ERR, "new_connection(): No memory left\n");		goto err;	}	memcpy(ptr->username.s, username, ptr->username.len + 1);	ptr->password.len = strlen(password);	ptr->password.s = (char*)pkg_malloc(ptr->password.len + 1);	if (!ptr->password.s) {		LOG(L_ERR, "new_connection(): No memory left\n");		goto err;	}	memcpy(ptr->password.s, password, ptr->password.len + 1);	ptr->host.len = strlen(host);	ptr->host.s = (char*)pkg_malloc(ptr->host.len + 1);	if (!ptr->host.s) {		LOG(L_ERR, "new_connection(): No memory left\n");		goto err;	}	memcpy(ptr->host.s, host, ptr->host.len + 1);	if (port && *port) {		ptr->port = atoi(port);	} else {		ptr->port = 0;	}	ptr->database.len = strlen(database);	ptr->database.s = (char*)pkg_malloc(ptr->database.len + 1);	if (!ptr->database.s) {		LOG(L_ERR, "new_connection(): No memory left\n");		goto err;	}	memcpy(ptr->database.s, database, ptr->database.len + 1);	pkg_free(buf);	return ptr; err:	if (buf) pkg_free(buf);	if (ptr && ptr->username.s) pkg_free(ptr->username.s);	if (ptr && ptr->password.s) pkg_free(ptr->password.s);	if (ptr && ptr->host.s) pkg_free(ptr->host.s);	if (ptr && ptr->database.s) pkg_free(ptr->database.s);	if (ptr) pkg_free(ptr);	return 0;}