if (found_service != NULL &&
g_strcmp0(found_service->usn, usn) == 0) {
SSDP_LOGD("Duplicated service!");
+ g_free(temp_url);
__SSDP_LOG_FUNC_EXIT__;
return;
}
found_service = (ssdp_service_s *)g_try_malloc0(sizeof(ssdp_service_s));
if (!found_service) {
SSDP_LOGE("Failed to get memory for ssdp service structure");
+ g_free(temp_url);
__SSDP_LOG_FUNC_EXIT__;
return;
}
SSDP_LOGD("resource unavailable\n USN: %s\n", usn);
+ if (browser->found_cb) {
+ browser->found_cb(found_service->service_handler,
+ SSDP_SERVICE_STATE_UNAVAILABLE, browser->cb_user_data);
+ }
+
g_hash_table_remove(g_found_ssdp_services, usn);
g_free(found_service->target);
g_free(found_service->usn);
SSDP_LOGD("Hash tbl size [%d]", g_hash_table_size(g_found_ssdp_services));
- if (browser->found_cb) {
- browser->found_cb(found_service->service_handler,
- SSDP_SERVICE_STATE_UNAVAILABLE, browser->cb_user_data);
- }
-
__SSDP_LOG_FUNC_EXIT__;
return;
}
if (i == 0 && c == '\n')
continue;
- if (c == '\n')
+ if (c == '\n' || c == EOF)
break;
buf[i++] = c;
if (i == 0 && c == '\n')
continue;
- if (c == '\n')
+ if (c == '\n' || c == EOF)
break;
buf[i++] = c;
ssdp_service_h serv_id;
printf("\nEnter target: (Example : upnp:rootdevice)");
- if(scanf("%ms", &target) < 1)
+ if(scanf("%255ms", &target) < 1)
return -1;
return -1;
printf("\nEnter usn: (Example : uuid:1234abcd-12ab-12ab-12ab-1234567abc12::upnp:rootdevice)");
- if(scanf("%ms", &usn) < 1)
+ if(scanf("%255ms", &usn) < 1)
return -1;
rv = ssdp_service_set_usn(serv_id, usn);
return -1;
printf("\nEnter url: (Example : http://192.168.0.110/)");
- if(scanf("%ms", &url) < 1)
+ if(scanf("%255ms", &url) < 1)
return -1;
rv = ssdp_service_set_url(serv_id, url);
char *target = NULL;
printf("\nEnter target: (Example : upnp:rootdevice)");
- if(scanf("%ms", &target) < 1)
+ if(scanf("%255ms", &target) < 1)
return -1;
rv = ssdp_start_browsing_service(target, &browser_id, &test_found_cb, NULL);