Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/restconf-method.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,8 @@ int data_post(struct CgiContext *cgi, char **pathvec, int root) {
retval = restconf_operation_failed_internal();
goto done;
}

key_out[0] = 0;
root_key_copy = str_dup(root_key);
struct json_object *created = NULL;
if ((created = json_get_object_from_map(top_level, root_key_copy))) {
Expand Down Expand Up @@ -700,6 +702,7 @@ int data_put(struct CgiContext *cgi, char **pathvec, int root) {

delete_uci = uci;

key_out[0] = 0;
if (yang_is_list(json_get_string(top_level, YANG_TYPE))) {
struct json_object *keys = NULL;
if ((keys = json_get_array(top_level, YANG_KEYS))) {
Expand Down
2 changes: 1 addition & 1 deletion src/restconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static int api_root(struct CgiContext *cgi) {
static int data_root(struct CgiContext *cgi, char **pathvec) {
int retval = 1;

if (pathvec[1] == NULL) {
if (vector_size(pathvec) == 1) {
// root
if (is_OPTIONS(cgi->method)) {
content_type_json();
Expand Down