Skip to content

Commit 91f0087

Browse files
committed
MiraMonVector fix error: Unexpected Non-nullptr Return
A nullptr is expected when the section is not present in an INI file. However, in a particular case, the function MMReturnValueFromSectionINIFile returned a value other than nullptr. Although this did not cause an immediate error, it resulted in incorrect information being presented to the user.
1 parent 26fc9a3 commit 91f0087

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

ogr/ogrsf_frmts/miramon/mm_wrlayr.c

+11-2
Original file line numberDiff line numberDiff line change
@@ -5318,7 +5318,16 @@ char *MMReturnValueFromSectionINIFile(const char *filename, const char *section,
53185318
}
53195319
else
53205320
{
5321-
value = section_header; // Freed out
5321+
if (section_header)
5322+
{
5323+
if (!strcmp(section_header, section))
5324+
value = section_header; // Freed out
5325+
else
5326+
value = nullptr;
5327+
}
5328+
else
5329+
value = nullptr;
5330+
53225331
fclose_function(file);
53235332
free_function(pszString);
53245333
return value;
@@ -6106,7 +6115,7 @@ int MMCheck_REL_FILE(const char *szREL_file)
61066115
{
61076116
MMCPLError(CE_Failure, CPLE_OpenFailed,
61086117
"The file \"%s\" must be REL4. "
6109-
"You can use ConvREL.exe from MiraMon software "
6118+
"You can use ModiREL.exe from MiraMon software "
61106119
"to convert this file to REL4.",
61116120
szREL_file);
61126121
return 1;

0 commit comments

Comments
 (0)