Fix a few chrashes is libgamestream

This commit is contained in:
Iwan Timmer
2015-08-02 15:00:03 +02:00
parent 01d891542b
commit 5a230c98f1
2 changed files with 6 additions and 4 deletions
+4 -3
View File
@@ -130,6 +130,10 @@ static int load_cert(const char* keyDirectory) {
} }
static int load_server_status(const char *address, PSERVER_DATA server) { static int load_server_status(const char *address, PSERVER_DATA server) {
char *pairedText = NULL;
char *currentGameText = NULL;
char *versionText = NULL;
int ret = GS_INVALID; int ret = GS_INVALID;
char url[4096]; char url[4096];
sprintf(url, "https://%s:47984/serverinfo?uniqueid=%s", address, unique_id); sprintf(url, "https://%s:47984/serverinfo?uniqueid=%s", address, unique_id);
@@ -144,9 +148,6 @@ static int load_server_status(const char *address, PSERVER_DATA server) {
goto cleanup; goto cleanup;
} }
char *pairedText = NULL;
char *currentGameText = NULL;
char *versionText = NULL;
if (xml_search(data->memory, data->size, "currentgame", &currentGameText) != GS_OK) { if (xml_search(data->memory, data->size, "currentgame", &currentGameText) != GS_OK) {
goto cleanup; goto cleanup;
} }
+2 -1
View File
@@ -113,8 +113,9 @@ PHTTP_DATA http_create_data() {
void http_free_data(PHTTP_DATA data) { void http_free_data(PHTTP_DATA data) {
if (data != NULL) { if (data != NULL) {
free(data);
if (data->memory != NULL) if (data->memory != NULL)
free(data->memory); free(data->memory);
free(data);
} }
} }