Skip to content

Commit

Permalink
Fix incorrect ENOMEM return in rsa_dfi
Browse files Browse the repository at this point in the history
  • Loading branch information
pnoltes committed Jan 13, 2024
1 parent 47b2f76 commit a727b46
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ celix_status_t importRegistration_create(
FILE *logFile,
import_registration_t **out) {
import_registration_t *reg = calloc(1, sizeof(*reg));
if (!reg) {
return CELIX_ENOMEM;
}

reg->context = context;
reg->endpoint = endpoint;
reg->classObject = classObject;
Expand All @@ -95,14 +99,13 @@ celix_status_t importRegistration_create(
reg->logFile = logFile;


if (reg && reg->version && reg->proxies && reg->interceptorsHandler) {
//printf("IMPORT REGISTRATION IS %p\n", reg);
*out = reg;
if (!reg->version || !reg->proxies || !reg->interceptorsHandler) {
importRegistration_destroy(reg);
return CELIX_ENOMEM;
} else {
importRegistration_destroy(reg);

}

*out = reg;
return CELIX_SUCCESS;
}

Expand Down

0 comments on commit a727b46

Please sign in to comment.