{"action":"opened","issue":{"url":"https://api.github.com/repos/sisoputnfrba/foro/issues/1426","repository_url":"https://api.github.com/repos/sisoputnfrba/foro","labels_url":"https://api.github.com/repos/sisoputnfrba/foro/issues/1426/labels{/name}","comments_url":"https://api.github.com/repos/sisoputnfrba/foro/issues/1426/comments","events_url":"https://api.github.com/repos/sisoputnfrba/foro/issues/1426/events","html_url":"https://github.com/sisoputnfrba/foro/issues/1426","id":465380139,"node_id":"MDU6SXNzdWU0NjUzODAxMzk=","number":1426,"title":"Duda con memory leak","user":{"login":"Dragonflares","id":28828524,"node_id":"MDQ6VXNlcjI4ODI4NTI0","avatar_url":"https://avatars1.githubusercontent.com/u/28828524?v=4","gravatar_id":"","url":"https://api.github.com/users/Dragonflares","html_url":"https://github.com/Dragonflares","followers_url":"https://api.github.com/users/Dragonflares/followers","following_url":"https://api.github.com/users/Dragonflares/following{/other_user}","gists_url":"https://api.github.com/users/Dragonflares/gists{/gist_id}","starred_url":"https://api.github.com/users/Dragonflares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dragonflares/subscriptions","organizations_url":"https://api.github.com/users/Dragonflares/orgs","repos_url":"https://api.github.com/users/Dragonflares/repos","events_url":"https://api.github.com/users/Dragonflares/events{/privacy}","received_events_url":"https://api.github.com/users/Dragonflares/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-07-08T17:38:54Z","updated_at":"2019-07-08T17:38:54Z","closed_at":null,"author_association":"NONE","body":"Buenas a todos!\r\n\r\nVengo hoy con una duda sobre un leak bastante molesto que me causa cuando creo un struct:\r\n\r\n![image](https://user-images.githubusercontent.com/28828524/60830407-82e4bc80-a18d-11e9-976b-c7ee8e477512.png)\r\n\r\nÉste struct se crea en la siguiente función:\r\n\r\n![image](https://user-images.githubusercontent.com/28828524/60830436-98f27d00-a18d-11e9-9387-d9bf078457ab.png)\r\n\r\nQue obtiene sus parámetros de la siguiente funcion:\r\n\r\n![image](https://user-images.githubusercontent.com/28828524/60830475-ae67a700-a18d-11e9-849c-405a2f754337.png)\r\n\r\nY los parámetros una vez ya copiados a otra direccion de memoria, destruyo sus punteros (los de los char**) así:\r\n\r\n![image](https://user-images.githubusercontent.com/28828524/60830530-cb03df00-a18d-11e9-9971-a4698357f94a.png)\r\n\r\nY en todos los demás lugares que llego a usarlos una vez que no son útiles los libero con la siguiente función:\r\n\r\n![image](https://user-images.githubusercontent.com/28828524/60830572-e969da80-a18d-11e9-929b-c0de91a64ca2.png)\r\n\r\n\r\nUna vez seteado éstas premisas, paso a explicar lo que creo que pasa y a solicitar alguna mano para evitarlo:\r\n\r\nCroe que el problema no está en que no los esté liberando sino que estoy pisando memoria previamente allocada y por eso salta un memory leak, es como tratar de hacer un string_new() a un char* y luego tirarle malloc y strcpy, lo anterior se queja porque se perdió.\r\n\r\nAlguna idea de como arreglarlo?\r\n\r\nDesde ya muchas gracias"}}
{"actor":{"display_login":"Dragonflares"}}