aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/iso19111/c_api.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/iso19111/c_api.cpp b/src/iso19111/c_api.cpp
index c205d039..6fafa2c8 100644
--- a/src/iso19111/c_api.cpp
+++ b/src/iso19111/c_api.cpp
@@ -145,9 +145,11 @@ static PJ *pj_obj_create(PJ_CONTEXT *ctx, const IdentifiedObjectNNPtr &objIn) {
// PROJ string.
}
}
- auto pj = new PJ();
- pj->descr = "ISO-19111 object";
- pj->iso_obj = objIn;
+ auto pj = pj_new();
+ if (pj) {
+ pj->descr = "ISO-19111 object";
+ pj->iso_obj = objIn;
+ }
return pj;
}
//! @endcond