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
25 changes: 13 additions & 12 deletions RedfishPkg/Library/HiiUtilityLib/HiiUtilityInternal.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ StorageToConfigResp (
(VOID **)&HiiConfigRouting
);
if (EFI_ERROR (Status)) {
FreePool (TempConfigRequest);
return Status;
}

Expand Down Expand Up @@ -662,6 +663,7 @@ StorageToConfigResp (
break;
}

FreePool (TempConfigRequest);
return Status;
}

Expand Down Expand Up @@ -1246,6 +1248,10 @@ LoadFormSetStorage (
(VOID **)&HiiConfigRouting
);
if (EFI_ERROR (Status)) {
if (ConfigRequest != NULL) {
FreePool (ConfigRequest);
}

return;
}

Expand All @@ -1269,18 +1275,9 @@ LoadFormSetStorage (
}

Storage->ConfigRequest = AllocateCopyPool (StrSize (ConfigRequest), ConfigRequest);
if (Storage->ConfigRequest == NULL) {
if (ConfigRequest != NULL) {
FreePool (ConfigRequest);
}

return;
}

if (Storage->Type != EFI_HII_VARSTORE_NAME_VALUE) {
if (ConfigRequest != NULL) {
FreePool (ConfigRequest);
}
ASSERT (Storage->ConfigRequest != NULL);
if (ConfigRequest != NULL) {
FreePool (ConfigRequest);
}
}

Expand Down Expand Up @@ -1696,6 +1693,9 @@ GetQuestionValue (
MaxLen = Length + 1;
ConfigRequest = AllocatePool (MaxLen * sizeof (CHAR16));
ASSERT (ConfigRequest != NULL);
if (ConfigRequest == NULL) {
return EFI_OUT_OF_RESOURCES;
}

StrCpyS (ConfigRequest, MaxLen, FormsetStorage->ConfigHdr);
if (IsBufferStorage) {
Expand All @@ -1711,6 +1711,7 @@ GetQuestionValue (
(VOID **)&HiiConfigRouting
);
if (EFI_ERROR (Status)) {
FreePool (ConfigRequest);
return Status;
}

Expand Down
2 changes: 1 addition & 1 deletion RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ RedfishCreateRedfishService (
}

if (EncodedAuthString != NULL) {
ZeroMem (BasicAuthString, EncodedAuthStrSize);
ZeroMem (EncodedAuthString, EncodedAuthStrSize);
FreePool (EncodedAuthString);
}

Expand Down
13 changes: 13 additions & 0 deletions RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,16 @@
#define REDFISH_HTTP_CACHE_DEBUG DEBUG_MANAGEABILITY
#define REDFISH_HTTP_CACHE_DEBUG_DUMP DEBUG_MANAGEABILITY
#define REDFISH_HTTP_CACHE_DEBUG_REQUEST DEBUG_MANAGEABILITY

/**
Return HTTP method in ASCII string. Caller does not need
to free returned string buffer.

@param[in] Method HTTP method.

@retval CHAR8 * Method in string.
**/
CHAR8 *
HttpMethodToString (
IN EFI_HTTP_METHOD Method
);
2 changes: 1 addition & 1 deletion RedfishPkg/RedfishHttpDxe/RedfishHttpOperation.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ HttpSendReceive (
return EFI_INVALID_PARAMETER;
}

DEBUG ((REDFISH_HTTP_CACHE_DEBUG_REQUEST, "%a: Method: 0x%x %s\n", __func__, Method, Uri));
DEBUG ((REDFISH_HTTP_CACHE_DEBUG_REQUEST, "%a: Method: %a %s\n", __func__, HttpMethodToString (Method), Uri));

ServicePrivate = (REDFISH_SERVICE_PRIVATE *)Service;
if (ServicePrivate->Signature != REDFISH_HTTP_SERVICE_SIGNATURE) {
Expand Down
10 changes: 4 additions & 6 deletions RedfishPkg/RedfishRestExDxe/RedfishRestExProtocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,21 +533,19 @@ RedfishRestExGetService (
RESTEX_INSTANCE *Instance;
EFI_REST_EX_SERVICE_INFO *ServiceInfo;

ServiceInfo = NULL;

if ((This == NULL) || (RestExServiceInfo == NULL)) {
return EFI_INVALID_PARAMETER;
}

OldTpl = gBS->RaiseTPL (TPL_CALLBACK);

Instance = RESTEX_INSTANCE_FROM_THIS (This);

ServiceInfo = AllocateZeroPool (sizeof (EFI_REST_EX_SERVICE_INFO));
if (ServiceInfo == NULL) {
return EFI_OUT_OF_RESOURCES;
}

OldTpl = gBS->RaiseTPL (TPL_CALLBACK);

Instance = RESTEX_INSTANCE_FROM_THIS (This);

CopyMem (ServiceInfo, &(Instance->Service->RestExServiceInfo), sizeof (EFI_REST_EX_SERVICE_INFO));

*RestExServiceInfo = ServiceInfo;
Expand Down
Loading