Skip to content
Snippets Groups Projects

E3-1197: Fix possible memory issues

Merged Lucas Magalhães requested to merge fix_valgrind into master
1 file
+ 4
3
Compare changes
  • Side-by-side
  • Inline
  • In function ‘compareVersions’,
        inlined from ‘require_priv’ at .././src/require.c:1025:29:
    .././src/require.c:640:9: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
      640 |   debug("require: compareVersions(found=%s, request=%s)\n", found, request);
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    .././src/require.c:601:28: note: in definition of macro ‘debug’
      601 |   if (requireDebug) printf(__VA_ARGS__)
          |                            ^~~~~~~~~~~
    .././src/require.c: In function ‘require_priv’:
    .././src/require.c:640:53: note: format string is defined here
      640 |   debug("require: compareVersions(found=%s, request=%s)\n", found, request);
          |                                                     ^~
    In function ‘compareVersions’,
        inlined from ‘require_priv’ at .././src/require.c:1025:29:
    .././src/require.c:640:9: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
      640 |   debug("require: compareVersions(found=%s, request=%s)\n", found, request);
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    .././src/require.c:601:28: note: in definition of macro ‘debug’
      601 |   if (requireDebug) printf(__VA_ARGS__)
          |                            ^~~~~~~~~~~
    .././src/require.c: In function ‘require_priv’:
    .././src/require.c:640:53: note: format string is defined here
      640 |   debug("require: compareVersions(found=%s, request=%s)\n", found, request);
          |                                                     ^~
    .././src/require.c:1031:50: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
     1031 |                 printf("require: %s %s may match %s\n", module, currentFilename,
          |                                                  ^~
+ 4
3
@@ -637,7 +637,8 @@ static int compareVersions(const char *found, const char *request,
@@ -637,7 +637,8 @@ static int compareVersions(const char *found, const char *request,
semver_t *sv_found, *sv_request;
semver_t *sv_found, *sv_request;
int match;
int match;
debug("require: compareVersions(found=%s, request=%s)\n", found, request);
debug("require: compareVersions(found=%s, request=%s)\n", found,
 
request ? request : "");
if (request == NULL || request[0] == 0) {
if (request == NULL || request[0] == 0) {
debug("require: compareVersions: MATCH empty version requested\n");
debug("require: compareVersions: MATCH empty version requested\n");
@@ -1020,7 +1021,7 @@ static int require_priv(
@@ -1020,7 +1021,7 @@ static int require_priv(
/* Look for highest matching version. */
/* Look for highest matching version. */
if (requireDebug)
if (requireDebug)
printf("require: checking version %s against required %s\n",
printf("require: checking version %s against required %s\n",
currentFilename, version);
currentFilename, version ? version : "");
switch ((status = compareVersions(currentFilename, version, FALSE))) {
switch ((status = compareVersions(currentFilename, version, FALSE))) {
case MATCH: /* all given numbers match. */
case MATCH: /* all given numbers match. */
@@ -1029,7 +1030,7 @@ static int require_priv(
@@ -1029,7 +1030,7 @@ static int require_priv(
if (requireDebug)
if (requireDebug)
printf("require: %s %s may match %s\n", module, currentFilename,
printf("require: %s %s may match %s\n", module, currentFilename,
version);
version ? version : "");
/* Check if it has our EPICS version and architecture. */
/* Check if it has our EPICS version and architecture. */
/* Even if it has no library, at least it has a dep file in the
/* Even if it has no library, at least it has a dep file in the
Loading