beaglebone.c: remove freeing of NULL var
authorBrendan Le Foll <brendan.le.foll@intel.com>
Thu, 30 Jul 2015 08:58:25 +0000 (09:58 +0100)
committerBrendan Le Foll <brendan.le.foll@intel.com>
Thu, 30 Jul 2015 08:58:25 +0000 (09:58 +0100)
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
src/arm/beaglebone.c

index 7723430..379337d 100644 (file)
@@ -194,7 +194,6 @@ mraa_beaglebone_uart_init_pre(int index)
         FILE* fh;
         fh = fopen(capepath, "w");
         if (fh == NULL) {
-            free(capepath);
             syslog(LOG_ERR, "uart: Failed to open %s for writing, check access rights for user", capepath);
             return ret;
         }
@@ -245,7 +244,6 @@ mraa_beaglebone_spi_init_pre(int index)
         FILE* fh;
         fh = fopen(capepath, "w");
         if (fh == NULL) {
-            free(capepath);
             syslog(LOG_ERR, "spi: Failed to open %s for writing, check access rights for user", capepath);
             return ret;
         }
@@ -284,7 +282,6 @@ mraa_beaglebone_i2c_init_pre(unsigned int bus)
         FILE* fh;
         fh = fopen(capepath, "w");
         if (fh == NULL) {
-            free(capepath);
             syslog(LOG_ERR, "i2c: Failed to open %s for writing, check access rights for user", capepath);
             return ret;
         }
@@ -327,7 +324,6 @@ mraa_beaglebone_pwm_init_replace(int pin)
         }
         fh = fopen(capepath, "w");
         if (fh == NULL) {
-            free(capepath);
             syslog(LOG_ERR, "pwm: Failed to open %s for writing, check access rights for user", capepath);
             return NULL;
         }