pdr: pldm_pdr_init(): Return NULL on allocation failure

Previously initialisation of the structure was protected from a failed
allocation using assert(). Instead, do what the API specification allows
us to do and perform an early exit by returning NULL.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: If6510014d383d815d42f48a2b607b12015e20bb2
diff --git a/src/pdr.c b/src/pdr.c
index 657612d..763fa72 100644
--- a/src/pdr.c
+++ b/src/pdr.c
@@ -117,7 +117,9 @@
 pldm_pdr *pldm_pdr_init(void)
 {
 	pldm_pdr *repo = malloc(sizeof(pldm_pdr));
-	assert(repo != NULL);
+	if (!repo) {
+		return NULL;
+	}
 	repo->record_count = 0;
 	repo->size = 0;
 	repo->first = NULL;